Re: A86: Random Number stuff


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

Re: A86: Random Number stuff




This is very true. It sometimes works for dice rolling however. For example.
In Monopoly, you need 2 random numbers 1-6. So what you do is you get a
random number when they push the 2nd, then wait for them to release, then
get another random number. That way they're both truly random.

----- Original Message -----
From: Andreas Finne <a_finne@hotmail.com>
To: <assembly-86@lists.ticalc.org>
Sent: Monday, January 10, 2000 3:07 AM
Subject: Re: A86: Random Number stuff


> 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.
>
> Another random routine using rom calls would be something like this:
> (Should be correct)
>
> xor a   ;ld a,0
> call _setXXop1  ;content of a into OP1
> ld a,10
> call _setXXop2  ;content of a into OP2
> call _randint   ;random integeter between OP1 and OP2->OP1
> call _convop1   ;convert number in OP1 to 'a'
>
> This routine would produce a random number between 0 and 10 into 'a'.
> It is very random, but very slow.
>
>
> Andreas Finne
> a_finne@hotmail.com
> a_finne@iobox.fi




References: