# Difference between revisions of "Sudoku"

From wikikotten

(→flow) |
|||

Line 11: | Line 11: | ||

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. | 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 | + | These X puzzles are then recursively analysed again |

## Revision as of 06:11, 12 February 2006

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 then 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