Anonymous avatar Anonymous committed c1df89f

Add the 2010-12-21 layout and now reading the board (without processing it.)

Comments (0)

Files changed (2)

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

         confess "X $y out of range.";
     }
 
-    if (not 
+    if (not
         ($verdict == $ABCP_VERDICT_NO)
         || ($verdict == $ABCP_VERDICT_MAYBE)
         || ($verdict == $ABCP_VERDICT_YES)
     return;
 }
 
+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.
+
+my $board_fn = shift(@ARGV);
+
+open my $in_fh, "<", $board_fn
+    or die "Cannot open '$board_fn' - $!";
+
+my $first_line = <$in_fh>;
+chomp($first_line);
+
+my $magic = 'ABC Path Solver Layout Version 1:';
+if ($first_line !~ m{\A\Q$magic\E\s*\z})
+{
+    die "Can only process files whose first line is '$magic'!";
+}
+
+my $layout_string = '';
+foreach my $line_idx (1 .. 7)
+{
+    chomp(my $line = <$in_fh>);
+    $layout_string .= "$line\n";
+}
+close($in_fh);
+
+print $layout_string;

abc-path/perl-quick-and-dirty/layouts/brain-bashers.2010-12-21.abc-path

+ABC Path Solver Layout Version 1:
+OWXIBQN
+J    AK
+E     L
+U     F
+Y     P
+R     S
+TVMGCDH
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.