Sliding Puzzle

A sliding puzzle is a combination puzzle that challenges you to slide pieces around a board to establish a certain end-configuration.

Objective

Move the tiles around the board to complete the puzzle in the least number of moves. You can only move a tile into an adjacent vacant space and there is only one vacant space on the board. The example below shows a potential random starting position for the board, where the blank tile is in the bottom, right corner, which means you can only move tiles 2 and 3 as your first move:

spg_example_random.png

To solve the puzzle you must move the tiles into order starting with tile 1 in the top left as shown below:

spg_example_complete.png

When competing against another bot, your challenge is to solve the puzzle in the least number of moves. In the event of a tie, (which can often be the case for the smaller boards), the bot that submits the solution first is the winner.

The board can be various sizes ranging from 3x3, 4x4 or 5x5 tiles and the blank tile always starts and finishes in the bottom right hand corner.

Useful Links

Use the links below to get a working example, that will let you immediately start playing a full game, where the bot will choose a random non-repeating move, until it solves the puzzle.

iconSlidingPuzzleBlack.png
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License