my $srand_init sub rand_int { my $n = shift(); $srand_init = (($srand_init * 4096) + 150889) % 714025; return int(($srand_init / 714025) * $n); }