9 | 11 | 6 | 14 |
8 | 2 | 1 | 3 |
7 | 12 | 13 | 15 |
4 | 5 | 10 | Free |
Time Elapsed: | 0 seconds |
---|---|
Moves: | 0 |
Status: | Select a tile to start. |
This is an implementation of the classic "15 Puzzle". The object is to arrange the tiles in order by sliding them around. A timer keeps track of how long it takes to solve the puzzle.
While developing this application I was able to verify that not all initial tile orderings can be solved. In fact, a randomly selected ordering has a 50% probability of being solved. To spare the player unnecessary frustration, I've included a check to ensure only solvable tile orderings are presented. The solvability algorithm is described at Wolfram MathWorld: 15 Puzzle.