Commits

Anonymous committed 22eee90

Moved xy_loop to the class.

  • Participants
  • Parent commits db04ff9

Comments (0)

Files changed (1)

File abc-path/perl-quick-and-dirty/abc-path-solver.pl

     return;
 }
 
-
-package main;
-
-# This will handle 25*25 2-bit cells and the $ABCP_VERDICT_MAYBE / etc.
-# verdicts above.
-
-my $verdicts_matrix = '';
-
-my $solver = Games::ABC_Path::Solver::Board->new({layout => \$verdicts_matrix});
 sub xy_loop
 {
-    my ($sub_ref) = (@_);
+    my ($solver, $sub_ref) = (@_);
 
     foreach my $y (0 .. $BOARD_LEN_LIM)
     {
     return;
 }
 
+
+package main;
+
+# This will handle 25*25 2-bit cells and the $ABCP_VERDICT_MAYBE / etc.
+# verdicts above.
+
+my $verdicts_matrix = '';
+
+my $solver = Games::ABC_Path::Solver::Board->new({layout => \$verdicts_matrix});
+
 my @letters = (qw(A B C D E F G H I J K L M N O P Q R S T U V W X Y));
 
 # Input the board.
 
     foreach my $letter_ascii (@$letter_list)
     {
-        xy_loop(
+        $solver->xy_loop(
             sub {
                 my ($x, $y) = @_;
 
 
     my ($l_x, $l_y) = @$xy;
 
-    xy_loop(sub {
+    $solver->xy_loop(sub {
             my ($x, $y) = @_;
 
             $solver->set_verdict($letter, $x, $y,
         {
             my @true_cells;
 
-            xy_loop(sub {
+            $solver->xy_loop(sub {
                 my @c = @_;
 
                 my $ver = $solver->get_verdict($letter, @c);
                 (($letter < $#letters) ? ($letter+1) : ()),
             )
             {
-                xy_loop(sub {
+                $solver->xy_loop(sub {
                     my ($x, $y) = @_;
 
                     if ($neighbourhood[$y][$x])
             }
         }
 
-        xy_loop(sub {
+        $solver->xy_loop(sub {
             my ($x, $y) = @_;
 
             my $letters_aref = get_possible_letters($x, $y);