/SudokuSolver

F# program to solve sudoku puzzles

Primary LanguageF#

I have made several refactorings and have cleaned up the code to make it easier for me to follow what it's doing. I've also eliminated all the mutable values and some temporary values.

The biggest change I made was to solve more than one puzzle. The input file is now in the format of one puzzle per line.

- CoderDennis


----------------- Original Readme -----------------------------

Program to solve Sudoku Puzzles written in F#

The solver is efficient in the places that count and solves "hard" sudoku 
puzzles in no more than 60 secs. The solver uses multiple cores to search 
for a solution and only very rarely spends more than a second on a solution.

Input is a file like this:
003020600
900305001
001806400
008102900
700000008
006708200
002609500
800203009
005010300

where 0 means the square is open. (Used on Project Euler)

Or like this:
..3.2.6..9..3.5..1..18.64....81.29..7.......8..67.82....26.95..8..2.3..9..5.1.3..
where "." means the square is open. This is what is most commonly used.

Put your soduku square in the test.sdk file and go

The sample above is taken from http://projecteuler.net/index.php?section=problems&id=96

Some "hard" problems are found on http://en.wikipedia.org/wiki/Algorithmics_of_sudoku. 
The sudoku problem in test.sdk is from there under the label "golden nugget"

I used http://www.sudoku-solutions.com/ to find and check solutions too.