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


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

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




But what if the number of times you increment R (IE, by executing) is
dependent upon the number of instructions you execute between game start and
the first keypress?  Of course, you have to be careful to ensure that R
increments by a prime number, but it'd work.

-- Barubary

> Take for example the flow of a program with just the statement "ld a,r" to
> gather a random number from.
>
> Let us assume that we want to randomly access a routine 1 out of every 4
> times, such that the following code would suffice:
>
> Let us assume that in an arbitrary sequence but specific number of
> statements, each time that the conditional jr nz is not met, the number of
> statements executed, and stored in r, ends with the last two bits being 1.
> This would mean that the number generated now is not random and therefore
> the program would execute as if there was no conditional statement.  This
is
> why a random routine needs more than just register r to be considered
> random.




References: