[comp.sys.mac.programmer] Random numbers

ARTABAR@MTUS5.BITNET (08/11/90)

Hell...I am attempting to do random number generation on an SE/30 (using
Think pascal 3.0). However, I dont get random (using the Mac's RANDOM
function) numbers...I get sequences...the same over and over. Is there any
way to make the numbers a bit more random appearing?
Please respond to me directly..I dont usually read this group. Thanx.
======================================================================
Blam.  "Stop!" Blam. Blam.        | Andy...
"Police!" Blam.                   | ARTABAR@MTUS5 (Bitnet)
                                  | ARTABAR%MTUS5.BITNET@VM1.NODAK.EDU
                                  |               (Internet)

cory@three.mv.com (Cory Kempf) (08/15/90)

ARTABAR@MTUS5.BITNET writes:

>Hell...I am attempting to do random number generation on an SE/30 (using
>Think pascal 3.0). However, I dont get random (using the Mac's RANDOM
>function) numbers...I get sequences...the same over and over. Is there any
>way to make the numbers a bit more random appearing?
>Please respond to me directly..I dont usually read this group. Thanx.

What you need is a seed value.  Every Random number algm. that I have seen
is DESIGNED to produce the same numbers, given the same seed (makes debugging
easier).  Common sources for seeds are things like the tickcount of the last
keyclick/mousedown, and the number of seconds since time began (the date in seconds),
among others.

+C
-- 
Cory Kempf				I do speak for the company (sometimes).
The EnigamI Co.							603 883 2474
email: cory@three.mv.com, harvard!zinn!three!cory