module TilePuzzle:sig
..end
Solver.PUZZLE
type
state
type
move =
| |
N |
(* | North | *) |
| |
S |
(* | South | *) |
| |
E |
(* | East | *) |
| |
W |
(* | West | *) |
typetile =
int
include Solver.PUZZLE
include Animation.PUZZLE
val of_list : int -> tile list -> state
n
and a list l
of size (n*n), creates a sliding tile puzzle.
The tiles of l
are placed from left to right, then from top to bottom. 0
represents the blank tile.
Example: of_list 2 [0; 3; 1; 2]
creates the board
+------+ | 3 | | 1 2 | +------+