Sudoku
From wikikotten
How does the following program works
Solves all sudoku puzzles for you
Lots have been said and discussed about solving Sudoku puzzles automatically.
The program above works in two modes .
It first creates a list of possible entries for all the empty squares. (1 loop in each dimension of the 3 dimensions , horizontal, vertical and within the block)
If then searches for the square with the least possiblities and spawns X new sudoku puzzles with N-1 unknow squares where N was the nr of unknown squares of the previous Puzzle.
These X puzzles are the recursively analysed again
flow
- 3 dimension check of puzzle with N unknown
- search for one of the squares with the lowest amount of possibilities
- spawn X puzzles with N-1 unknown entries
- check if puzzle is solved ==> if yes print out and exit
- feed them to this algorithme again