> evenly. This is only true for N==2 (in which case, your algorithm > happens to work!). >
Hmm, I see... well then, based on on your feedback, I have improved my
original algorithm:
sub shuffle {
my $deck = shift;
my $size = @$deck;
fisher_yates_shuffle ( $deck ) if @$deck > 2;
my ($j, $t);
for (@$deck) {
use integer;
$t = $deck->[$j = 0 + rand $size];
$deck->[$j] = $_;
$_ = $t;
}
}
