![]() |
Random?
I have EasyC V2 and downloaded the trial version of easyC Pro. I don't find a random function in either program. Is there a reason for that or is there a workaround?
|
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. |
| All times are GMT -5. The time now is 00:19. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi