Re: A86: Random Number stuff


[Prev][Next][Index][Thread]

Re: A86: Random Number stuff




In a message dated 1/9/00 10:31:24 PM Mountain Standard Time, david@acz.org 
writes:

> That is a pretty bad way to generate random numbers.  It's actually
>  incremented twice by some instructions (I believe all the extended ones, 
and
>  the IX/IY ones).
>  
>  One good method is to multiply a 16 bit value by a constant 16 bit value,
>  and store the result as the seed for the next time.  Another method is to
>  use a table, and use a 16 bit counter to keep track of the results.  On the
>  86, you have the ROM as a fairly random table, so no need to generate a
>  unique table.

Yes, using seeds (one, two, three, etc...the more the better, usually) is a 
better way to get random numbers, but it's generally slower (right?).

JayEll