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

Frank Pittel fpittel at gmail.com
Thu May 18 23:03:48 EDT 2017


The trick is to get a reasonably random seed number. Use the same seed and
you get the same result.

On Thu, May 18, 2017 at 9:52 PM, Bruce W. Calkins <brucewcalkins at charter.net
> wrote:

> Short answer: No.
>
> Longer answer: RND calls some sort of psudo-random lookup table. If you
> enter the table at the same point you will get the same sequence out.  You
> need to "randomize" the entry point.  As someone mentioned one method is to
> add the command RND(timer) Which calls the current timer value, which is
> generally different each time, one is hard pressed to turn on their CoCo,
> load a program and run it in the same time repeatedly.
>
> Bruce W.
>
>
>
>
> On 05/18/2017 08:39 PM, Rietveld Rietveld wrote:
>
>> I used the RND command to generate a random game play option in the
>> cocoflash, but it doesn't seem to be very random. Some titles come up more
>> than the laws of probability would suggest is possible.   instead I am now
>> using a small math equation that uses a PEEK of the clock value.   This has
>> resulted in a far more random looking selection
>>
>> Sent from my BlackBerry 10 smartphone.
>>
>>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>


More information about the Coco mailing list