Commits

Shlomi Fish committed 0df0a0e

Convert to the return-the-input-array-ref semantics of _shuffle.

Comments (0)

Files changed (1)

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

     my ($self, $stack, $l, $cell_int) = @_;
 
     vec($l, $cell_int, 8) = 1+@$stack;
-    my $cells = $self->_get_next_cells($l, $cell_int);
-    $self->_shuffle($cells);
 
-    push @$stack, [$l, $cells];
+    push @$stack, [$l, $self->_shuffle($self->_get_next_cells($l, $cell_int))];
 
     return;
 }
                 # Yay! We found a configuration.
                 my $handle_clue = sub {
                     my @cells = @{shift->{cells}};
-                    $self->_shuffle(\@cells);
-                    return [map { $layout->get_cell_contents($_) } @cells];
+                    return
+                    [
+                        map { $layout->get_cell_contents($_) } 
+                        @{$self->_shuffle(\@cells)}
+                    ];
                 };
                 my $riddle =
                 Games::ABC_Path::Generator::RiddleObj->new(
                 }
             }
 
-            $self->_shuffle(\@pairs);
-
-            $last_state->{pos_pairs} = \@pairs;
+            $last_state->{pos_pairs} = $self->_shuffle(\@pairs);
         }
 
         my $chosen_clue = $last_state->{chosen_clue};
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.