| Age | Commit message (Collapse) | Author |
|
|
|
|
|
When we are solving, resolve naked singles without going into recursion.
Naked singles are cells which have only one possibility left.
For those cells, we cross off the possibility for all other unsolved
cells in the same row, column or box, and put the cell in the set
of solved cells. We keep resolving naked singles before recursing.
|
|
|
|
|
|
|
|
|
|
If the option --X is given, we're assuming the Sudoku is an X-Sudoku.
An X-Sudoku is a regular Sudoku with an additional constraint that
the number on the main and anti-diagonals are unique.
This was very easy to implement -- other than parsing the option,
all that needed to be changed was the method which determines what
other cells a particular cell can see.
|
|
|
|
Special handling of duplicate numbers only need to be taken if $diff
equals 0. $n - $m == $A with $n == $m can only happen if $A == 0.
|
|
|
|
|
|
|
|
|
|
It's possible to have NxN Sudoku's, with only different N-1 clues.
If that is the case, we make an educated guess, based on whether
the clues are numbers only, letters only, a mixture, and whether
there are any "holes".
|
|
Some sudokus larger than 9x9 use all letters for clues. Some use
numbers 1 .. 9 followed by letters.
We're now excepting both. And we don't require them to be consecutive.
It's possible to have one less different clue that the size of the
sudoku, in that case, we have to make an educated guess (number or
letter) what the missing clue is.
|
|
That is, any line which doesn't contain an underscore, digit or
capital ASCII letter will be ignored. This makes inputting large
sudoku's a tad bit easier, allowing blank lines or hyphens between blocks.
|
|
Assumes a brick like pattern of blocks, where the blocks are wider
than they are high.
|
|
|
|
|
|
16x16 sudokus will reach the warn limit.
|
|
We know also accept letters 'A' .. 'Z' as clues. They will be
mapped to 10 .. 35.
|
|
|
|
Instead of using a binary search to find matching numbers, we will
be using a hash. This reduces the time complexity from
O (N log N) worst case to O (N) expected.
|
|
|
|
|