Commits

Shlomi Fish committed 108c737

Now calling to $self->{'rand'}->shuffle.

Comments (0)

Files changed (1)

abc-path/Games-ABC_Path-Generator/lib/Games/ABC_Path/Generator.pm

 
 sub _fisher_yates_shuffle {
     my ($self, $deck) = @_;
-    return unless @$deck; # must not be empty!
 
-    my $r = $self->{'rand'};
-
-    my $i = @$deck;
-    while (--$i) {
-        my $j = $r->max_rand($i+1);
-        @$deck[$i,$j] = @$deck[$j,$i];
-    }
-
-    return;
+    return $self->{'rand'}->shuffle($deck);
 }
 
 {