I'm trying to write a program to generate random number, within a range of predetermined numbers, while not having any duplicate numbers.
for instance:
I need 5 (non duplicate) numbers, between 1 and 10.
I tried using Rand, and then looping to regenerate number that were duplicated. But, that sat there running for about an hour, and never got all the numbers to be unique.
Any help on this would be greatly appreciated.
Thanks in Advance,
-Charles...
2007-11-30
00:20:25
·
6 answers
·
asked by
Anonymous
in
Programming & Design