Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to randomize
Message
From
28/11/2001 16:26:58
 
 
To
08/11/2001 12:28:16
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00578749
Message ID:
00587197
Views:
45
>>
>>Don't forget to seed the rand.
>
>Randomize without a seed uses a value based on the system's timer. Is there a pitfall to watch for if you don't specify a seed?


Only when getting multiple consecutive rands you can actually get the same seed due to system speed.
I wrote a random function that works very well. Basically it creates two arrays of random numbers then it chooses a random number of the max dimension of array one to get the array element from the first array which is full of random numbers of the max dimension of array two. Array two is full of randoms with a set max called into the funtion. The element is selected and its value is the returned random number. This type of retentive randing is especially good for consecutive random number generation. I have used it to get one 2,500,000 random in 24 seconds but a series of 1,000,000 three digit numbers only took just under 4 seconds!!!

~Joe Johnston USA

"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams

Previous
Reply
Map
View

Click here to load this message in the networking platform