[A89] Re: really random numbers


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

[A89] Re: really random numbers




At 18:44 2002-01-16, you wrote:

>OK, I want a really random number.  I know that most random number
>generators just generate erratic but completely deterministic sequences
>for a given initial value (the seed).  So I thought about maybe making
>the seed random, like setting it to a part of memory that changes often.
>I figured that the video memory (i.e. the home screen before it's
>cleared) would probably be a good choice.  Is there a possibly better
>choice like the stack?  I plan to set the seed before anything else in
>the program.

Is your program interactive?
then try have a register increment while waiting for a keypress.
for a 16 bit value it would probably be best to take it from two 
keypresses, two 8 bit counters, and combine them to a 16 bit value to have 
it more random.
Then use this as seed.

///Olle





References: