So much fun.
If you limit yourself to 8 passes in your loop, and you get a duplicate, you will not get a new value, eh? So your final list will be short.
The trick (well, there are many) is to take a different tack, where the goal of getting 8 entries is paramount. I would suggest similar code as you already have, but with something like:
Code: Select all
repeat until the number of items of randTemp = 8
Now this might have issues with large samples. Can you see why?
Another way is (pseudo):
Code: Select all
create list of 36 numbers
repeat 8
get a random number based on the number of items in that list
place that item in randTemp
delete that item from the master list
See?
Can you think of other ways?
Craig Newman