JM> I wrote a cheap random number generator macro. It works best
JM> with a ram drive. I didn't look at cs-mac or anything else to
JM> write this so can you guys tell me how this compares with other
JM> programs of this type? It uses the DOS time command and picks a
JM> number between 1 and 100.
jj,
I use the built-in variables that Fred provided, this saves
the writing to ramdrive. This random number maker also is keyed to
the DOS time function, so only one "random" number per second and
the "random" number increases once per second .
{:xxxx}
{call rand_no}
{divi rand,99}
{info-d5s0 Your random number is %_rem}
{}
{:rand_no} ;subroutine returns how many seconds
{setv rand,%_day} ;how many days since the month started?
{decr rand}
{mult rand,24} ;how many hours since the month started?
{incr rand,%_24h}
{mult rand,60} ;how many minutes since the month started?
{incr rand,%_min}
{mult rand,60} ;how many seconds since the month started?
{incr rand,%_sec} ;maximum 2,678,400 lines
{incr rand}{retu} ;return a number from 1 to 2,678,400
Feel free to crib from CS-MAC anytime, all I ask is that you
give me credit if you get stuff out of there.
05/20/95 10:03 ChuckùS
-*-
þ JABBER v1.3á1 #á021 þ {Commo} þ Don't rank professionals with amateurs.
--- Opus-CBCS 1.7x via O_QWKer 1.1
---------------
* Origin: BlinkLink - Perceiving is believing! 412-766-0732 (1:129/89.0)
|