Hi,
I've been using the following code to shuffle a deck of cards with the commented out section used to remove the previous choice from the list of possible cards remining to be randomly selected. Upon perusing the AmigaGuide file it appears that the RemoveItem command could replace those three lines of code.
Code: Select all
for local i=1 to qty
tblChoice[i]=i
next
; Randomly choose from choices
for i=1 to qty
id = rnd(qty+1-i) + 1
tblDeck.render[i]=tblChoice[id]
; Remove choice and shrink possible choices by 1
junk=REMOVEITEM(tblChoice,id)
; I thought that the above REMOVEITEM code would replace the following three lines but it does something different
;for j=id to qty-i
; tblChoice[j]=tblChoice[j+1]
;next
next
Thanks!
Nathan