home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / c / 13265 < prev    next >
Encoding:
Text File  |  1992-09-07  |  1.3 KB  |  33 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!cs.utexas.edu!torn!maccs!rickan
  3. From: rickan@maccs.dcss.mcmaster.ca (Mark Rickan)
  4. Subject: Re: Initializing Random Seeds 
  5. Message-ID: <1992Sep5.165949.19916@maccs.dcss.mcmaster.ca>
  6. Organization: Department of Computer Science, McMaster University
  7. Date: Sat, 5 Sep 1992 16:59:49 GMT
  8. Lines: 23
  9.  
  10. In article <hawkeye.715690233@glia> hawkeye@glia.biostr.washington.edu
  11. (Ken Keys - TF Dude) writes:
  12.  
  13. >One commonly used seed on UNIX systems is time(NULL) + getpid().
  14. >By the way, why do you feel the need to seed the generator more than once?
  15.  
  16. I'm actually running the process on demand, which makes it necessary
  17. to introduce a new random seed. Unfortunately, there is a remote possibility
  18. that the user could keep up the system on a fast machine (this is more
  19. for 'dummy-proofing' than accuracy). The program will ultimately be
  20. system-specific and GUI-based (you'd have to have pretty fast reflexes!),
  21. so I may simply determine the process ID or time in milliseconds for
  22. added assurance.
  23.  
  24. Cheers,
  25.  
  26. Mark
  27.  
  28. -- 
  29.  -------------------------------------------------------------------------
  30.  = Mark Rickan                         ...!uunet!utai!utgpu!maccs!rickan = 
  31.  = DCSS, McMaster University               rickan@maccs.dcss.mcmaster.ca = 
  32.  ------------------------------------------------------------------------- 
  33.