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

Rietveld Rietveld rietveldh at hotmail.com
Fri May 19 23:19:14 EDT 2017


Thank you for the advice. I will substitute 'NUM' with L since L always represents the total bumper of entries flashed

Sent from my BlackBerry 10 smartphone.
  Original Message
From: Barry Nelson
Sent: Friday, May 19, 2017 10:04 PM
To: coco at maltedmedia.com
Reply To: CoCoList for Color Computer Enthusiasts
Subject: Re: [Coco] Is the RND command really generating a random number?


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.



--
Coco mailing list
Coco at maltedmedia.com
https://pairlist5.pair.net/mailman/listinfo/coco


More information about the Coco mailing list