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

  1. #include "comment.header"
  2.  
  3. extern void seed(long int*);
  4.  
  5. void uRandom(long int *i)
  6. /* random number generator */
  7.   {
  8.    if (*i == 0)
  9.      seed(i);
  10.    else
  11.      {
  12.       *i = *i * 137 % 3833;
  13.       if (*i < 0) *i = -*i;
  14.    }
  15. }  /* end random */
  16.