A Su Doku solver
The goal of a Su Doku problem is to complete the published grid so that no
number appears more than once in any row, column or 3x3 subgrid. The rules are
described more fully on the official Su Doku website, to which a link is
provided above. To set up the solver, simply type the numbers printed in The
Times into the corresponding squares in the grid below. (The Tab and Shift-Tab
keys allow the grid to be navigated without use of the mouse). Squares that are
blank in The Times should be left blank in the grid. Once all the values have
been copied across from the newspaper, use the buttons to the right of the
grid.
Instructions appear underneath.
Solve
There are three solve buttons:
-
Solve
completes the grid (provided that a solution exists).
-
Unsolve resets any squares on the grid filled by a previous press of the Solve
button.
-
Reset resets the entire grid.
Evaluate
Evaluate checks to see whether the current incomplete grid has a unique
solution. The Time field records the time taken to solve the puzzle. (The
command-line solver runs considerably faster than the applet because it doesn't
cache the intermediate solutions or state grids).
Shuffle and Labelling Format
The Shuffle button performs a random series of reflections, rotations and
digit rearrangements in order to create a new puzzle that has a similar
structure to before.
The drop-down list to the right of the Evaluate button allows the user to
switch between the 'Numeric from 1' format used by the majority of
sources, the 'Alphanumeric from 0' format used by the 4x4 puzzles in The
Independent and the 'Text' format used by the Wisden Cricketer magazine,
where the numbers 1-9 seen in the traditional puzzle are replaced by the nine
letters of a cricket-related word or phrase such as 'TENDULKAR' or 'SIXANDOUT'.
The Clipboard
Copy transfers the current grid into a separate clipboard window (the
system clipboard cannot be used for security reasons) in the format selected in
the drop-down box on the far right of the row. The supported formats are Plain
Text, Library Book (the XML format used by the Pappocom Sudoku
software) and the various state grid types. Once Copy
has been pressed, simply select the displayed grid in the clipboard window,
press Ctrl-Insert to copy it, then press Shift-Insert from within some other
document, such as a new e-mail message. The grid will look its best rendered in
a monospaced font such as Courier. Paste performs the opposite
operation, i.e. it transfers a grid from the clipboard window (which must have
been previously opened by a press of the Copy button) to the solver.
(Only the Plain Text format is supported by the Paste operation). Suppose you
have received an e-mail that contains a Su Doku puzzle in the approved
clipboard format. Select the grid from within the document, then press
Ctrl-Insert in order to copy the grid to the system clipboard. Press
Shift-Insert within the clipboard window to copy the text there, then press the Paste
button to copy the grid from the clipboard window into the solver.
Resize
Although classical Su Doku puzzles use a 3x3 grid of boxes, the Su Doku Solver
supports the alternative box grids that are sometimes seen. Use the Resize
button to change the grid size. Be aware that the grid might not display
properly if a very large grid has been chosen.
Compose
Compose composes a fresh puzzle. The new puzzle is certain to be
symmetrical, have a unique solution and feature the requested number of filled
cells. Note that complicated puzzles (in the case of the classic 3x3 Su Doku
puzzle, 'complicated' usually means with less than 24 filled cells) might take
a considerable time to generate. Press Break in order to interrupt the
procedure.
Patterns
The Patterns section dictates which patterns should be detected during the
Solve phase. The meanings of the various patterns are discussed on the
Strategy Types page. The numbers to the right refer (except in the case
of Guess) to the total number of candidate move eliminations performed due to
the discovery of each type of pattern. In the case of Guess, the figure is the
total number of guesses performed.
Reasoning
The text box at the bottom displays the reasoning that has been used to solve
the puzzle. Click part-way through the reasoning in order to view partial
solutions.
Important Note
Since Release 1.21, the Su Doku Solver has been compiled with the JDK 5.0
version of the javac compiler, which has meant that users with version 1.4 or
earlier of the Java Runtime Environment (JRE) installed on their PCs have
observed irregular behaviour. Error messages such as:
java.lang.NoSuchMethodError: java.lang.StringBuffer.append(Ljava/lang/String;)Ljava/lang/AbstractStringBuilder;
have appeared in the Sun Java Console (which is accessed from the Tools menu on
Internet Explorer). To see which version of the JRE is installed on any PC,
type:
java -version
at the Command Prompt. A message such as:
'java' is not recognized as an internal or external command, operable program or batch file.
means that the JRE is not installed on the PC at all, whereas a message such as:
java version "1.5.0_04"
means that the latest (as I type) version is installed. (Version 1.5 is a
synonym for Version 5.0). Users with an earlier version (or no JRE at all)
should download JRE 5.0 from the
Sun Java website.
Alternatively, users should click on the Solver 1.20 link in the left-hand panel,
which will display the last version of the Solver to be compatible with JRE 1.4.
Recommended Browser
The Su Doku Solver applet is best viewed through the Firefox browser. Click on
the button in order to download.