// random.cpp
// Linear congruential psuedo-random number generator.
// Generates psuedo-random sequence of integers in
// range 0 .. RANDMAX.
#define RANDMAX 6074 // RANDMAX = M - 1
int random (int seed = 0)
{
static int next = 1;
static int A = 106;
static int C = 1283;
static int M = 6075;
if (seed) next = seed;
next = next * A + C;
return next % M;
}