                     !Puzzle
                     ======= 

!Puzzle displays a fifteen tile sliding block puzzle
for you to solve.  To move the tiles click on a tile
which is on the same row or column as the blank
square - the tile will be moved towards the blank.
Move the tiles until they are in order from left to
right, top to bottom:

               1  2  3  4
               5  6  7  8
               9 10 11 12
              13 14 15

To get a new (random) layout use the pop-up menu.
The rest of this document describes how to solve
the puzzle - don't read any further yet!



Any puzzle of this form (a square grid of any size
with one tile missing - the blank) can be solved by
arranging the outer ring of tiles correctly, then
arranging the next ring of tiles and so on:

First:

              1  2  3  4
              5  ?  ?  8
              9  ?  ? 12
             13 14 11 15

Then arrange the three tiles in the middle:

              1  2  3  4
              5  6  7  8
              9 10    12
             13 14 11 15

Then shift the blank to the bottom right (move
11 up and then 15 to the left).

The blank must end up in the bottom right position,
but it is needed while solving the inner rings -
so the initial layout of each outer ring takes one
tile from an inner ring (the bottom right tile in
that ring in the final arrangement) and positions it
temporarily one square downwards.  Finally (when the
inner ring has been solved) the blank must be
positioned at the bottom right of the inner ring:-

                  T  T
                  T  B

(B is the Blank, T is the appropriate Tile for that
position).  Then, the tile below the blank is moved
up, the one to the right of the new blank position
moved to the left and so on until the blank is in
the bottom right.

Notice that, if the puzzle has an odd number of
tiles along each side, the inner ring will have only
one tile.  The solution described in this document
deals with this by solving the two inner most rings
(nine tiles) specially - see below.

To solve each ring get the corners into position
first.  Remember that that bottom right corner
needs to be the tile which will be one position to
the left in the final arrangment.  With the fifteen
tile puzzle:-

              1  ?  ?  4
              ?  ?  ?  ?
              ?  ?  ?  ?
             13  ?  ? 15

Now solve each of the sides.  Remember that the
tile to the left of the bottom right corner comes
from the ring of tiles inside the one you are
currently solving.

To solve a single side start at one end (it doesn't
matter which) and shift tiles into the correct
places until you get to the last but one tile.
Put this tile in the position of the last tile and
put the last tile to the inside of this one ensuring
that the blank is still inside the ring which you
are completing.  Notice that, for the fifteen tile
puzzle, the last but one tile is the first one; so
you must start at this step:

           1  T  2  4
           T  ?  3  T
           T  ?  ?  T
          13  T  T 15

? is any tile or blank, T is any tile, but not the
blank.  Now move the tile in the last but one
position out (put the blank at this position), then
move the tile at the last position into the last
but one (2) and move the last tile into position
(3).

Repeat this for each side.

When you get to the inner most ring with a puzzle
with an even number of tiles along each edge you
should find that when the blank is at the bottom
right corner the other tiles are in the correct
place - if not someone has tampered with the puzzle
(by taking it apart) and rearranged the tiles.  It
is impossible to solve the puzzle in this case.

!Puzzle will not do this, unless someone has
tampered with the program!

If the puzzle has an odd number of tiles along each
edge you will eventually get to a position where you
only have nine tiles left to do (the two innermost
rings).  Solve these by solving the left and top
edges first.

First get the top leftmost tile into position, then
the two remaining tiles along the top - position the
middle tile at the right, the rightmost tile below
it, then move the blank to the middle position, move
the middle tile into place and then the top
rightmost tile.  Now position the two remaining
tiles in the left edge in the same way.  At this
point you will have three tiles and the blank left
to position, move the blank round until all three
tiles are in the correct position.

!Puzzle only implements the fifteen tile puzzle.
If you want to try other combinations you will
either have to make your own (using cardboard and
a big pair of scissors) or, if you have sufficient
expertese, by altering the !Puzzle program (which
is written in BASIC).
