home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / go / prog / nextgo23.taz / nextgo23 / NeXTGo / random.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-02-09  |  233 b   |  17 lines

  1. #include "comment.header"
  2.  
  3. extern void seed(int*);
  4.  
  5. void Random(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.  
  17.