![]() ![]() | ![]() |
version 1.117, 2002/09/23 21:08:03 | version 1.118, 2002/09/26 20:45:00 |
---|---|
Line 603 sub shuffle { | Line 603 sub shuffle { |
if (defined(@$a)) { | if (defined(@$a)) { |
&Apache::response::setrandomnumber(); | &Apache::response::setrandomnumber(); |
for($i=@$a;--$i;) { | for($i=@$a;--$i;) { |
my $j=int rand($i+1); | my $j=int(&Math::Random::random_uniform() * ($i+1)); |
next if $i == $j; | next if $i == $j; |
@$a[$i,$j] = @$a[$j,$i]; | @$a[$i,$j] = @$a[$j,$i]; |
} | } |