Created
August 6, 2011 17:02
-
-
Save masak/1129521 to your computer and use it in GitHub Desktop.
a proof-of-concept usage of the sudoku solver
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat example | |
use 5.010; | |
use Reader::Sudoku; | |
use Solver::DancingLinks; | |
use Writer::Sudoku; | |
my $header = {}; | |
my $body = <<'EOD'; | |
12 4. | |
.. .1 | |
2. 34 | |
.3 1. | |
EOD | |
my $reader = Reader::Sudoku->new( | |
header => $header, | |
body => $body, | |
); | |
my $solver = Solver::DancingLinks->new( | |
matrix => $reader->matrix, | |
writer => $reader->writer, | |
); | |
$solver->solve(); | |
$ perl example | |
12 43 | |
34 21 | |
21 34 | |
43 12 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment