Sudoku Solver

Sudoku solver can solve sudoku grids, for example:

$ cat grid1.ssg
75___68__
9_25__4__
_4____67_
_1__8__6_
___2__5_1
4____1__9
139_5____
__63____7
____92_38

$ ./sudokusolver -f grid1.ssg
-------------------
|7 5 .|. . 6|8 . .|
|9 . 2|5 . .|4 . .|
|. 4 .|. . .|6 7 .|
-------------------
|. 1 .|. 8 .|. 6 .|
|. . .|2 . .|5 . 1|
|4 . .|. . 1|. . 9|
-------------------
|1 3 9|. 5 .|. . .|
|. . 6|3 . .|. . 7|
|. . .|. 9 2|. 3 8|
-------------------
Solution:
-------------------
|7 5 1|4 3 6|8 9 2|
|9 6 2|5 7 8|4 1 3|
|3 4 8|1 2 9|6 7 5|
-------------------
|2 1 3|9 8 5|7 6 4|
|6 9 7|2 4 3|5 8 1|
|4 8 5|7 6 1|3 2 9|
-------------------
|1 3 9|8 5 7|2 4 6|
|8 2 6|3 1 4|9 5 7|
|5 7 4|6 9 2|1 3 8|
-------------------

The usage is the following:

usage: sudokusolver [option]
  Accepted options:
   -p                plain text output (default)
   -w                html output
   -f file           input file, stdin is used if not specified
   -q                display only the solution



Online version

This program is used online in the OnlineSudokuSolver page (in a cgi script).

Installation