[Coco] Is the RND command really generating a random number?

Barry Nelson barry.nelson at amobiledevice.com
Fri May 19 22:03:47 EDT 2017


It helps a lot you reseed the random generator from time to time from TIMER when some user interaction occurs. For the the CoCo Flash menu you are working on, you could seed it once when the program starts from the TIMER, and then when the R key is pressed reseed using something like this:
Start of program
SEED=RND(-TIMER)

When R is pressed
SEED=RND(-TIMER*RND(0)):SELECT=RND(NUM)

Where NUM is the number of possible selections and RND(NUM) will return a number from 1 to NUM. This should be pretty random as it based off two randomly timed events.




More information about the Coco mailing list