|
Re: Random?
A "pure" random number generator does not exist in either. However, you can make a pseudo-random number generator that's a close enough approximation:
Start a timer before the program:
Each time through the loop, divide the timer value by a number like four or nine*, and store the modulus to a variable.
The modulus (the % operator) is now your "random" number.
* The size of your random number pool will depend on how high you set this. If you want a bigger range of random numbers, set this higher.
|