CTJ
Random Generator method
oooooor
you could make a list1 with all numbers from 0 to maxint
then remove ones that are already on list2
and then pick a random number from that list1 and insert it to your output list2
that way you'd avoid loops altogether
58 replies
Random Generator method
Well I imagined it something like
Enter loop
Generate random number
check if number is in list
if yes add and break
if loop is repeated more than say 100 times break and do something
or alternatively you can build checker to see if every possible number was used yet
58 replies