Skip to content

Instantly share code, notes, and snippets.

@masak
Created August 6, 2011 17:02
Show Gist options
  • Save masak/1129521 to your computer and use it in GitHub Desktop.
Save masak/1129521 to your computer and use it in GitHub Desktop.
a proof-of-concept usage of the sudoku solver
$ 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