Article View: comp.sys.mac
Article #12997Re: Random number Generator wanted.
From: Samuel Hahn
Date: Fri, 06 Jul 1990 19:34
Date: Fri, 06 Jul 1990 19:34
11 lines
1113 bytes
1113 bytes
This may be a bit obvious but why don't you just generate a long number one character at a time? For instance to go between 0 and 999999999999 just pick each digit from random() mod 9? This won't be very fast but it should work if you are willing to accept the limitations of the built in random number generator... It also gets a bit trickier if you want numbers between 0 and say 945832427, but it could still be done with a bunch of conditional statements. Sam Hahn
Technical Details
Message-ID:
<1990Jul6.193430.9990@athena.mit.edu>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!snorkelwacker!bloom-beacon!hstbme.mit.edu!shahnReferences:
<152@asacsg.mh.nl> <1990Jun29.020739.9146@Neon.Stanford.EDU> <1990Jun30.170949.1426@Neon.Stanford.EDU> <8999@goofy.Apple.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!snorkelwacker!bloom-beacon!hstbme.mit.edu!shahn From: shahn@hstbme.mit.edu (Samuel Hahn) Newsgroups: comp.sys.mac,comp.sys.mac.programmer,comp.sys.mac.misc,comp.sys.mac.system Subject: Re: Random number Generator wanted. Message-ID: <1990Jul6.193430.9990@athena.mit.edu> Date: 6 Jul 90 19:34:30 GMT References: <152@asacsg.mh.nl> <1990Jun29.020739.9146@Neon.Stanford.EDU> <1990Jun30.170949.1426@Neon.Stanford.EDU> <8999@goofy.Apple.COM> Sender: news@athena.mit.edu (News system) Reply-To: shahn@hstbme.mit.edu.UUCP (Samuel Hahn) Organization: Massachusetts Institute of Technology Lines: 11