Why yet another sudoku program?
I wanted to write small app which assists in creating new
hard puzzles and evaluates how hard any puzzle is. Of course that was quite big
task and it included solver with full solutions tree scanning, optimizer and
some other components. Solver turned out to be really fast! On Latitude X1
notebook with 1.1GHz micro volt centrino optimization goes at the rate of 7000
solutions per second. Finally I added GUI part and printing to complete this
app and decided to give it away to anyone interested.
What can it do:
Turn any harmless easy puzzle into true “evil” one.
Manually or Automatically create puzzles. Save them into file. Solve, get
hints, modify and print.
Screenshot 1: Original puzzle example
Screenshot 2: Puzzle with multiple solutions after analysis.
There is nothing to install. Just copy downloaded executable to any directory and run it.
I recommend to create shortcut on the desktop by Ctrl+Shift+drag file to the desktop.
When app starts, Puzzle board is on the left. Use mouse and keyboard to
change any cell. Cells with original clues can be changed as well. On the
right side there are two lines with information and dozen of buttons:
Clear – Remove all numbers from the board and erase history.
Load – Read new puzzle from .sud file and erase history.
Save as – Store content of the board into .sud file.
Store – Add content of the board to the history in memory. Like a snapshot.
Back – Return one snapshot back in the stored history.
Forward – Go one snapshot forward in the history.
Check – Checks current board for presence of single solution.
Analyze – Just like Check, but shows more information about the puzzle. See description below.
Can be used with Shift key to show complete solution.
Optimize – Removes maximum number of extra cells from the puzzle.
Clue – Highlights cell which you should look at when solving puzzle manually.
Generate New Puzzle – Current version of Sudoku CAD generates moderate asymmetrical puzzles.
Use with Shift to enter puzzle number. It is displayed in the caption bar for new puzzles.
Print – Prints current board on single page.
More about Check:
Check will try to solve what is on the board and will determine
if there's zero, one or more then one possible solution. When board has one solution - second
line will display how many "Leaps of Faith" (LOF) had to be made in order to completely scan
the puzzle.
Current version of solver is not entirely Deductive. It has to make guesses sometimes. My wife
called such guesses "Leaps of Faith" when solving by brain. Most puzzles including what newspapers
call "hard" are solved with zero LOF, but some "evil" or "really tough" ones may take as many
as about 50. This LOF count is for complete scan of the puzzle and not just until first
solution is found.
More about Analyze:
Analyze will solve the puzzle first.
If there is one solution it will then try to take away one clue at the time and check if puzzle
still has one solution. Such cells are called redundant and show in pink on the board.
If there's many solutions - all of them will be found and empty cells will show possible values in
order of descending solutions count. So if cells shows "53" that means that all solutions have 5
or 3 in this cell and 5 is present in more solutions. This allows to create puzzle manually.
Shift+Analyze will show complete solution.
Optimization:
Optimization in this version has minimum number of clues necessary for
single solution as a goal.
When puzzle has extra clues and single solution optimizer tries to remove clues in groups with the
goal to remove maximum number of them. If more then one possibility exists - combination which results
in more LOF wins.
Clue button:
When you use this program to solve puzzle by brain and get stuck you can
use this button.
If immediate LOF is not necessary - Solver will highlight cell where to look next. If LOF is in
order - highlighted cell will have correct digit.
Generate new puzzle:
Generation algorithm attempts to generate puzzle
with no LOF, but it is possible that some will be present because it stops as soon as single solution
was achieved. Final touch after generating "raw" puzzle is optimization which removes maximum number of
clues but causes no LOF.