|
Aside from using a method which will incur some overhead, you can't. And if it's random, you should allow for the possibility of having a duplicate. You could keep a list of previous numbers and check for a duplicate if you wanted to. Or, you could keep a pool of valid numbers, shuffle it up, and remove randomly indexed values from the shuffled list.
__________________
<insert disclaimer here>
<insert shameless plug for Visual Studio here>
|