Re: A82: Re: Random routine - human reaction times


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

Re: A82: Re: Random routine - human reaction times




Okay, this is what I assumed was going on with the r register anyway. I
haven't looked at any z80 books/documentation for ages, but I was under
the impression that it (more or less) gets incremented by 2 for each
machine instruction that is executed (or memory acces or whatever).
Assuming that the processor is still in im1, the code at $0030 will keep
getting executed even while the game waits for player input.
In other words I assumed that r would serve as a reasonable random seed
since the number of times it is incremented during gameplay, or before
hand in TIOS and the shell, is practically unknowable.

-Jeremy


On Mon, 6 Dec 1999, Barubary wrote:

> 
> Here's a simple way to handle this problem of not having a random enough
> seed.
> 
> Have a high-density counter count continuously from the time the cards are
> displayed to the time that you reveal the first card.  When the first card
> is revealed, THAT'S when you randomize them, using the counter as a seed.
> 
> Human reaction times, especially when measured with a very fast (Z80 is fast
> enough) counter, are basically random.
> 
> PGP uses this fact when you generate a secret key for yourself - that's why
> it asks you to type crap stuff.  It's timing how long you take between each
> keypress.  A 1 millisecond difference in your typing speed will cause a
> difference of 1000 (assuming a 1 mhz counter, which is about right in
> multitasking environment) in the random numbers - that's extremely good.
> PGP doesn't even care which keys your press (especially because that's
> "human-random").
> 
> -- Barubary
> 
> 



Follow-Ups: References: