Hi guys,
What would you think is the fastest way to generate a list of random numbers, without any doubles.
At the moment I am using the following loop:
do
generate random number
do
check whether number is in arraylist "uniques" (building if not)
if so EXIT and repeat generate random numberloop
until noDoubles
UNTIL all numbers are generated
I want to use this for shuffling a deck of cards, but then a million times to simulate the probability of certain "hands" in poker.
thnx in advance
Marc
PS: I had a thread a while ago concerning this problem but never tried to improve the speed.
What would you think is the fastest way to generate a list of random numbers, without any doubles.
At the moment I am using the following loop:
do
generate random number
do
check whether number is in arraylist "uniques" (building if not)
if so EXIT and repeat generate random numberloop
until noDoubles
UNTIL all numbers are generated
I want to use this for shuffling a deck of cards, but then a million times to simulate the probability of certain "hands" in poker.
thnx in advance
Marc
PS: I had a thread a while ago concerning this problem but never tried to improve the speed.