- or download this
my $M = 8;
my $A = 5;
...
$X = (($X * $A) + 1) % $M;
return ($X);
}
- or download this
+---------------+
| + |
...
|+ |
| + |
+---------------+
- or download this
my $Y = 0;
my @T = (0) x $M;
...
($Y, $T[$Y]) = ($T[$Y], lcrng());
return ($Y);
}
- or download this
+---------------+
| + +|
...
|+ |
| + + |
+---------------+
- or download this
$Y == 1
@T == ( 1, 1, 1, 1, 1, 1, 1, 1 )