[Coco] Random number generator in B09

Harry Hurst hhos at st-tel.net
Thu Jan 2 22:38:11 EST 2014


>  Is there a fix or some ideas how to work around Basic09 and it's RND
> function that keeps repeating the same numbers on every instance of
> starting
> B09?
>  Once B09 is running each call on this function seems to work but each
> start
> of Basic09 reverts back to the same ol' stuff again.
>

You might try starting your application a loop that keeps generating
random numbers until it terminates when you press a key (BASIC09 has an
INKEY function, right?). Also, some RND functions have an option to supply
a seed number. You could give the number seconds since midnight, or a
counter in an INKEY loop, or a combination of the two.

Regards,
HH




More information about the Coco mailing list