Re: A86: Random Numbers
[Prev][Next][Index][Thread]
Re: A86: Random Numbers
In a message dated 4/10/99 10:58:55 PM Eastern Daylight Time,
ivan37@hotmail.com writes:
> How can I get random integers? Is there a command like
> BASIC's randint? I see randint in the token lists, is this the only
> way? I have looked for tutorials on tokens, 'cause I don't know
> about them, but haven't found any. Could someone help me? Thanks
>
_randint equ $5544
input:
OP1,OP2 = min and max integers (arguments 1 and 2 in basic function)
output:
OP1=random integer
example:
store a random integer between 10 and 25 in register a
ld a,10
call _SetXXOP1 ;OP1=10
ld a,25
call _SetXXOP2 ;OP2=25
call _randint ;get random number
call _CONVOP1 ;a=OP1