[A83] Re: Randomization


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

[A83] Re: Randomization




At 04:18 PM 12/11/01 +0100, you wrote:

>At 15:42 2001-12-11, you wrote:
>
> >Yes, this is the way it's done; Using a recursive function. But can you give
> >us an example of such a function?
>
>here is one simple, and one extremly simple (and extremly fast):
>http://www.ticalc.org/pub/85/asm/source/routines/rand.asm
>
>///Olle


We also had this discussion a bit ago.  If you call the random functions at 
random intervals, you can use the command ld a,r to get the memory refresh 
number.  This only works if the number is in response to say, the user 
pressing a key, because otherwise it gets to be rather linear.  For 
occassional random number at random intervals, however, it is the fastest 
way I can think of.  You might even try:

ld a,r
ld h,a
ld a,r
ld l,a
ld a,(hl)

to get a random number from memory, from a random address.







Follow-Ups: References: