/* "random" number generator - this doesn't have any solid principles
   behind it, it's just something I threw together and it worked
   reasonably well. */

global int randstore1, randstore2

global int rand() {
  int temp
  temp = (randstore1 * randstore2) + (randstore2 << 8) + (randstore1 >> 8)
  randstore1 = randstore1 + temp - 5
  randstore2 = randstore2 - (temp >> 3)
  return (temp)
}

global void srand(int r1, int r2) {
  randstore1 = r1
  randstore2 = r2
}
