TIB: mixing up a list
[Prev][Next][Index][Thread]
TIB: mixing up a list
Ok i have a list of 56 elements. 26 1's and 26 2's. what is the fastest way i
can mix them up, or create a list with 26 1's and 26 2's in random order
right now i have two for loops that pick a random spot in the list and put in
a number
ex
For(a,1,26
Lbl gn
randint(1,52)\->\b
if cards(b)<>0 <> means not equal to
goto gn
1\->\cards(b)
end
For(a,1,26
Lbl gn2
randint(1,52)\->\b
if cards(b)<>0 <> means not equal to
goto gn2
2\->\cards(b)
end
this code slows down as the last numbers are filled so i need a faster way to
do this
thanks
matt c
http://junkworld.cjb.net