It is a Java applet I created that is able to solve any puzzle that involves fitting polyominoes in some solution frame. The shape of the pieces and the solution can be defined freely.
Downloading the solver applet gives you the opportunity to define your own polyomino puzzles, and have them solved by the applet. Note that if you just want to run a few of the predefined puzzles, you don't need to download the applet, but can instead run it directly from the Polyomino Solver page.
You need a Java enabled Web browser. If you're not sure your browser qualifies, try to run one of the solutions on the Polyomino Solver page. To define your own puzzles you need a simple text editor (like TextEdit on the Macintosh or Notepad in Windows), and a bit of patience.
A zip file containg all necessary files is here: PolyominoSolver.zip.
After downloading either file, unpack it; the result is the folderr "PolyominoSolver", which contains all files you need to run the applet. You can throw the downloaded .zip file in the trash; you won't need it any longer.
To start the applet you need to create an HTML file with the definition of the puzzle to be solved. This can easily be done using a simple text editor. Using the editor of your choice, create a file with these contents (you can copy & paste from this page to make things more easy):
<HTML> |
Save the file you created as "Run4x15.htm" in the "PolyominoSolver" folder. Now open this file in your Internet Browser, using the "Open" command in the "File" menu. If you did everything correcty, a window appears in which the 4 x 15 pentomino puzzle runs.
These lines, as you probably have guessed, contain the definition of the puzzle as well as the commands to start the applet. To define your own puzzle, you need to understand the lines that contain "<PARAM NAME=... VALUE=...>" . Each of these lines contains a puzzle parameter with the name specified after "NAME=", and a value specified after "VALUE=". Here is an explanation of each of the parameters.
Name |
Meaning |
---|---|
Version |
Defines the format of the specification, and must always be 2. |
PuzzleWidth |
The width of the smallest rectangle that completely surrounds the solution. The width is measured in unit squares. |
PuzzleHeight |
The height of the smallest rectangle that completely surrounds the solution. The height is measured in unit squares. |
NumPieces |
The number of pieces defined in the next lines. |
Piece1, Piece2 etc. |
There is one parameter for every piece, which have to be numbered from 1 upwards to the number of pieces. The value of the parameter consists of a number of subparts, separated by comma's:
|
Holes |
This is an optional parameter. Its purpose is to define any "holes" in the solution frame that are excluded from the area to be covered. It contains a series of number pairs; each pair is an (x, y) coordinate of a unit square. The coordinate of the lower-left square of the smallest rectangle that completely surrounds the solution is (1, 1). |
CheckIsoFreq |
This is an optional parameter. It defines how often the solver should check for isolated areas within the puzzle that can not be solved for obvious reasons (for example when there is an isolated area with size 33, and only hexominoes are available, then a solution is clearly impossible). This type of checking is rather costly in terms of processing power, so for many simple puzzles (such as the pentominoes) it is better to omit the CheckIsoFreq parameter (or assign it the value 0). For more complex puzzles, like the hexomino puzzles, this option can be very useful. For example, when you specifiy the value 10 for CheckIsoFreq, the check for isolated areas is conducted after placing every 10th piece |
AFPInSmallest |
Possible values are true or false. Normally, this one should be set to false. When true, the solver examines the situation after putting a piece in the solution, and if two or more disjunct areas are present, it solves the smallest of these areas first. When set to true, it implies a CheckIsoFreq of 1 (and the value specified for CheckIsoFreq is ignored). Using this option costs a lot of extra processing time. |
Note that in the above HTML code an area is defined for the applet to run in. This is done by specifying a width of 400 (pixels) and a height of 300. You are free to change these numbers. The applet will adapt the size of its drawing to the size of its assigned area.
You won't need them for any of the pentomino puzzles. If your puzle is more complex (has more pieces), chances are the solver won't find any solutions for a long time. If this is the case, choose the option "Update display manually" in the solver window. This shows you the pieces actually placed so far in the solution. You can refresh it by clicking the "Refresh" button. If you discover an uncovered area in the puzzle that cannot be filled and doesn't go away for a long time, you clearly need the CheckIsoFreq parameter. Start by setting it to 50 or so, and check again with "Update display manually". If necessary, lower the value of CheckIsoFreq. Sometimes the uncovered area that blocks things is the size of only one piece, and cannot be filled because that piece is already being used in another place. In that case you also need to set AFPInSmallest to true.
Note that setting CheckIsoFreq to 1 and AFPInSmallest to false is a bad choice: if CheckIsoFreq is 1 you might just as well set AFPInSmallest to true, because the extra procesing time is used anyway.
Check out these files: RunP59.html and RunP66.html. The former contains definitions of the pentomino and tetromino pieces; the latter defines the 35 hexominoes.
Be aware that not all of the puzzle definition files on my site are good examples; as a matter of fact many still use an obsolete format of the puzzle definition syntax, which has been replaced by the format described here.