Selecting and saving puzzles
The program always starts up showing a grid randomly chosen from its set of built-in puzzles. Users can also select specific puzzles from this collection via the "Select puzzle" option in the File menu. In addition, users can enter a grid of their own choosing, maybe from one printed in a newspaperor or cut and pasted from a web site, or they can read puzzles from files. Partially completed puzzles can be saved to disk so that the search for their solution can be continued on another occasion.
If the user reads a puzzle from a file or enters a puzzle by hand it is possible that the puzzle has more than one solution (all the built-in puzzles have only a single solution). Most would consider puzzles with more than one solution incorrect and obviously the program's ability to monitor mistakes cannot function when this is the case. To cater for the possibility that such a puzzle has been entered the program has an option "Check puzzle" in the File menu which tests the current puzzle to see if it has more than one solution. On most machines this test can take several seconds to complete. While this is happening the puzzle cannot be altered. When it is finished a window will appear reporting the outcome. This window must be closed via its "OK" button before the program can continue.
The built-in puzzles, currently around 200, were created by the program using the algorithms it makes available to the user. A typical display from the "Select puzzle" menu is shown in Figure 1. A puzzle is selected by double clicking on the corresponding line and then clicking "OK". The puzzles are numbered at the left hand side, and so here number 138 has been selected.
When the program generates the built-in puzzles the Simplest first strategy is used to solve them and a note is taken of how many times it applies each algorithm. These counts are shown in the Puzzle selector window. The right hand column of the Puzzle selector gives the puzzle difficulty rating. The puzzles are ordered on their difficulty rating - the first puzzle has the lowest score and the last the highest. Users can hence choose puzzles which contain specific patterns or by their difficulty rating. Another way of examining which algorithms are needed to solve puzzles is described in the show difficulty section.
Entry of new grids is initiated using the "Enter new puzzle" option in the File menu. This brings up a Puzzle entry window (see Figure 2.) which is a simple editor into which puzzles may be typed or pasted in any of the allowed formats. The program reads the puzzle from the Puzzle entry window when the user clicks the "LOAD" button.
The program then checks the input data: first, can it recognise the format and extract 9 good lines of numbers; secondly can it solve the puzzle. If the first test fails a message will appear saying "Error in input" and, if possible, giving the line number (see Figure 3.). If the second test fails the message "Cannot solve puzzle" will appear. In each case the user can correct the data and reload it, or quit using the "QUIT" button.
Note that on XP I paste into the Puzzle entry window using the "Ctrl v" command, and on Linux I use middle mouse button.
Note that you can make sure that the entered puzzle has only one solution by using the Check puzzle option in the File menu.