#reimplemented random to get the same random numbers on different Python implementations RAND_MAX = 0x7fff def random(): global rand_seed rand_seed = (rand_seed * 214013 + 2531011) % 4294967296 return ((rand_seed // (2*RAND_MAX + 1)) & RAND_MAX) / RAND_MAX def uniform(a, b): return random()*(b - a) + a def seed(s): global rand_seed rand_seed = s