Re: A86: Random
[Prev][Next][Index][Thread]
Re: A86: Random
Jimmy's random routine is very fast, and is great if you just want a single
random number every now and then. But if you for instance want to have
random coordinates chosen one after the other, it is not as good. I have
made a program to try out different random routines by taking random
coordinates and put out a sprite at the chosen location. With this routine
the results were something like this:
00 0
0 00
0 00
0 0 0
All sprites were in an area from the upper left to the lower right. You will
get a little better results if you put a 'halt' between every call to the
random routine.
Andreas Finne
a_finne@hotmail.com
a_finne@iobox.fi
>From: Matt C <snoborder420@yahoo.com>
>here is Jimmy Mardell's random routine from Tetris,i
>think
>i use it alot
>
>random: ; Creates a random number 0 <= x < A
> push bc
> push de
> push hl
> ld b,a
> ld a,r
> add a,a
> ld hl,0
> ld d,0
> ld e,a
>RMul:
> add hl,de
> djnz RMul
> ld a,h
> pop hl
> pop de
> pop bc
> ret
>
>later
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com