{ my $seed; sub ppSrand{ $seed = int( $_[ 0 ] & 32767 ); } sub ppRand{ my $max = shift // 1; $seed = ( $seed * 214013 + 2531011 ); $seed &= 0xffffffff; return ( ( $seed >> 16 ) & 32767 ) / 32768 * $max; } }