Re: A92: random number
[Prev][Next][Index][Thread]
Re: A92: random number
Thank you for your help, but I didn't mean that exactly. I wanted to know an
algorithm to generate random numbers, for example with a pen and a sheet of
paper, and then how to code this algorithm in assembly for Fargo. Thanx.
MP
-----Message d'origine-----
De : Daniel S Plaisetd <dsplaisted@juno.com>
À : assembly-92@lists.ticalc.org <assembly-92@lists.ticalc.org>
Date : mardi 8 septembre 1998 01:53
Objet : Re: A92: random number
>
>On Mon, 7 Sep 1998 19:05:02 +0200 "Philippe HUCK"
><philhuck@club-internet.fr> writes:
>>Does anybody know how to generate random numbers ? And in assembly,
>>what would it be ?
>>
>>Merci. Thanx.
>>
>>MP
>Flib::Random does it easily. Here's what flib.h says:
>
>;---------------------------------------------
>; random(void)
>;
>; Function: Return a pseudorandom number
>;
>; input: D0.W = upper limit
>; output: D0.W = random number in [0..limit-1]
>;---------------------------------------------
>flib::random equ flib@000C
>
>
>So you just put the upper limit in d0, and call the function.
>It returns a number between (And including) zero and the
>upper limit minus one. So d0 is 6 when you call it it will
>return 0,1,2,3,4, or 5
>
>Hope this helps...
>
>Daniel Plaisted
>dsplaisted@bigfoot.com
>ICQ#-10360037
>
>_____________________________________________________________________
>You don't need to buy Internet access to use free Internet e-mail.
>Get completely free e-mail from Juno at http://www.juno.com
>Or call Juno at (800) 654-JUNO [654-5866]
>
Follow-Ups: