Commits

Shlomi Fish committed fc66292

Implement a TODO.

This is in regards to the conversion to ::Coord.

Comments (0)

Files changed (1)

abc-path/Games-ABC_Path-Solver/lib/Games/ABC_Path/Solver/Board.pm

         confess "Letter $letter out of range.";
     }
 
-    return $letter * $BOARD_SIZE + $self->_xy_to_int([$xy->y,$xy->x]);
+    return $letter * $BOARD_SIZE + $self->_xy_to_int([$xy->y, $xy->x]);
 }
 
 sub _get_verdict
         confess "Invalid verdict $verdict .";
     }
 
-    vec(${$self->_layout}, $self->_calc_offset($letter,$xy), 2)
+    vec(${$self->_layout}, $self->_calc_offset($letter, $xy), 2)
         = $verdict;
 
     return;
                                 vars =>
                                 {
                                     target => $neighbour_letter,
-                                    coords => [$xy->x,$xy->y],
+                                    coords => [$xy->x, $xy->y],
                                     source => $letter,
                                 },
                             }
                         {
                             vars =>
                             {
-                                coords => [$xy->x,$xy->y],
+                                coords => [$xy->x, $xy->y],
                                 letter => $letter,
                             },
                         },
             if ((!@min_coords) or (@$letters_aref < @min_options))
             {
                 @min_options = @$letters_aref;
-                # TODO : Convert to a ::Coord object.
-                @min_coords = ($xy->x,$xy->y);
+                @min_coords = ($xy);
             }
         }
 
 
     if (@min_coords)
     {
-        my ($x, $y) = @min_coords;
+        my ($xy) = @min_coords;
         # We have at least one multiple rank cell. Let's recurse there:
         foreach my $letter (@min_options)
         {
             $self->_add_move(
                 Games::ABC_Path::Solver::Move::TryingLetterForCell->new(
                     {
-                        vars => { letter => $letter, coords => [$x, $y], },
+                        vars => { letter => $letter, coords => [$xy->x, $xy->y], },
                     }
                 ),
             );
 
             $recurse_solver->_set_conclusive_verdict_for_letter(
-                $letter, Games::ABC_Path::Solver::Coord->new({x => $x, y => $y}),
+                $letter, $xy
             );
 
             $recurse_solver->_solve_wrapper;
                         vars =>
                         {
                             letter => $letter,
-                            coords => [$x,$y],
+                            coords => [$xy->x, $xy->y],
                         },
                     }
                     )
                 $self->_add_move(
                     Games::ABC_Path::Solver::Move::ResultsInASuccess->new(
                         {
-                            vars => { letter => $letter, coords => [$x,$y],},
+                            vars => { letter => $letter, coords => [$xy->x, $xy->y],},
                         }
                     )
                 );
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.