home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume5 / smallc / part3 / lib / rand.c < prev    next >
Encoding:
Text File  |  1986-11-30  |  216 b   |  18 lines

  1.  
  2. int xxseed;
  3.  
  4. srand (x) int x; {
  5.     xxseed = x;
  6. }
  7.  
  8. rand () {
  9.     xxseed = xxseed * 251 + 123;
  10.     if (xxseed < 0) xxseed = - xxseed;
  11.     return (xxseed);
  12. }
  13.  
  14. getrand () {
  15.     puts ("Type a character");
  16.     return (getchar() * 123);
  17. }
  18.