home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Games / MacGnuGo 0.5e / gnugo.src / seed.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-25  |  326 b   |  23 lines  |  [TEXT/R*ch]

  1. #include "comment.header"
  2.  
  3. #define MAC
  4. #ifdef MAC
  5. void seed(long int *i)
  6. { *i = TickCount(); }
  7. #else
  8.  
  9. #include <sys/time.h>
  10.  
  11. void seed(long int *i)
  12. /* start seed of random number generator for Sun */
  13.   {
  14.    struct timeval tp;
  15.    struct timezone tzp;
  16.  
  17.    gettimeofday(&tp, &tzp);
  18.    *i = tp.tv_usec;
  19. }  /* end seed */
  20.  
  21. #endif
  22.  
  23.