in reply to Is this a fair shuffle?
sub shuffle (@) { my @a=\(@_); my $n; my $i=@_; map { $n = rand($i--); (${$a[$n]}, $a[$n] = $a[$i])[0]; } @_; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is this a fair shuffle?
by adrianh (Chancellor) on May 02, 2004 at 13:47 UTC |