aboutsummaryrefslogtreecommitdiff
path: root/challenge-086/abigail/perl
AgeCommit message (Collapse)Author
2020-11-14Trivial updatesAbigail
2020-11-14Improve commentAbigail
2020-11-14Special case naked singles.Abigail
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.
2020-11-14Remove redundant parensAbigail
2020-11-14Fix commentAbigail
2020-11-13Fix commentAbigail
2020-11-13Remark we are using brute forceAbigail
2020-11-13Solve X-sudokus.Abigail
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.
2020-11-13Remark we will use a module to do all the workAbigail
2020-11-12Some simplification.Abigail
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.
2020-11-11Added lots of comments.Abigail
2020-11-11Improve readability.Abigail
2020-11-11Rename two variablesAbigail
2020-11-11Use a bit field to keep track of possibilities.Abigail
2020-11-11Make an educated guess what the missing clue is.Abigail
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".
2020-11-11Less restrictions on clues.Abigail
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.
2020-11-11Ignore lines not containing clues.Abigail
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.
2020-11-11Handle NxN sudokus where N is not a square.Abigail
Assumes a brick like pattern of blocks, where the blocks are wider than they are high.
2020-11-10Pad output with spaces if $SIZE > 10, and the printed numbers are less.Abigail
2020-11-10Don't print '[ ' and ' ]' in the output.Abigail
2020-11-10Don't warn on deep recursion.Abigail
16x16 sudokus will reach the warn limit.
2020-11-10Be more lenient in what the accept.Abigail
We know also accept letters 'A' .. 'Z' as clues. They will be mapped to 10 .. 35.
2020-11-10Sudokus could be any size (assuming a square size)Abigail
2020-11-10Improve performance.Abigail
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.
2020-11-10Perl solution for week 86, challenge 2.Abigail
2020-11-09Perl solution for week 86, part 1.Abigail