View Single Post
Old Feb 14th, 2007, 5:00 AM   #2
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 770
Rep Power: 3 Jimbo is on a distinguished road
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>
Jimbo is offline   Reply With Quote