Xref: utzoo comp.sys.mac:55985 comp.sys.mac.programmer:15775 comp.sys.mac.misc:1080 comp.sys.mac.system:719 Path: utzoo!attcan!uunet!snorkelwacker!apple!ucscb.ucsc.edu!alexr From: alexr@ucscb.ucsc.edu (Alexander M. Rosenberg) Newsgroups: comp.sys.mac,comp.sys.mac.programmer,comp.sys.mac.misc,comp.sys.mac.system Subject: Re: Random number Generator wanted. Message-ID: <9009@goofy.Apple.COM> Date: 6 Jul 90 00:35:58 GMT References: <8999@goofy.Apple.COM> Sender: usenet@Apple.COM Reply-To: Alex_Rosenberg.INTEGRATION@gateway.qm.apple.com Organization: Hacker's Anonymous Lines: 31 In article <8999@goofy.Apple.COM> alexr@ucscb.ucsc.edu (Alexander M. Rosenberg) writes: > Apple's random number generator uses the tick count as a seed upon each > InitGraf (I may be wrong here, but I'm sure that it is time derived.) I do > know that the mouse driver has always kept track of the time at which a > click occurs, and takes the difference in time between that click and the > previous one, and adds this number to the current randSeed. This is where > an additional level of randomness is provided. (Humans tend to be more > "random" than computers do, eh?) Just to protect my sanity, I checked. The standard ADB mouse driver does the aforementioned random seed changes, to a low memory global, RndSeed ($156). InitGraf does use 1 as a seed. (a silly seed). Under Random, they suggest using RndSeed (the low-memory global) as a seed. I suspect that something in the system must use this as a seed. I was working from memory. Oops. Alex P.S. I'm sure that pre-ADB mouse driver code does the same thing. --------------------------------------------------------------------------- - Alexander M. Rosenberg - INTERNET: alexr@ucscb.ucsc.edu - Yoyodyne - - 330 1/2 Waverley St. - UUCP:ucbvax!ucscc!ucscb!alexr - Propulsion - - Palo Alto, CA 94301 - BITNET:alexr%ucscb@ucscc.BITNET- Systems - - (415) 329-8463 - Nobody is my employer so - :-) - - - so nobody cares what I say. - -