[Coco] Random number generator in B09
billg999 at cs.uofs.edu
billg999 at cs.uofs.edu
Thu Jan 2 22:58:47 EST 2014
> Doesn't look like it. The BASIC09 Reference manual says:
> RND(number)
> [...]
> Â If number =0 then range = 0 to 1
> Â If number>0 then range = 0 to number
> [...]
> Â Â ....are not truly random but occur in a predictable sequence.
> Specifying a number less than 0 begins the sequence over.
Not according to my reference card.
RND(n) ....
if n<0 uses ABS(n) aas new seed number.
Assuming one has the clock set one can use the numeric values
combined some how (I doubt it relly matter how) to create the
new seed and as the time never occurs more than once the numbers
should be as close to random as you can hope for.
As a side note, I have always been amazed at the idea of even
thinking a computer is capable of doing anything random. The
number is always generated bvy some mathematical algorithm and
any randomness is purely accidental. :-)
bill
More information about the Coco
mailing list