A 4 x 4 grid is filled (in some way) with 15 movable tiles labeled 1, ..., 15. One square is left blank (marked here by "0"). Tiles can be rearranged by moving a tile into a blank square (assuming the two locations share an edge). The goal is to rearrange the tiles so that they are arranged from 1 to 15 in the row-major order, with the blank square occupying the left top corner. That is, the goal configuration is:
0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15

INPUT: An initial placement of tiles described by a set of atoms "in0(I,J,X)" (integer X is in row I and column J).

OUTPUT: A set of actions (swaps) that converts the initial configuration to the goal configuration.


15p.16      (distance to goal - 16 steps)
15p.17      (distance to goal - 17 steps)
15p.18      (distance to goal - 18 steps)
15p.19      (distance to goal - 19 steps)