Sliding Puzzle

Slide the tiles into the empty space until they read in order, left to right and top to bottom, with the gap in the bottom-right corner.

How to play

The board is a square grid of numbered tiles with one empty space. You can move any tile that's next to the gap into it. Clicking a tile further away in the same row or column slides the whole line at once, just like pushing a row of tiles on a real puzzle. The puzzle is solved when the tiles read 1, 2, 3 … in order from left to right, top to bottom, and the gap is in the bottom-right corner.

Tiles that are already in their correct position turn green, which makes it easy to see your progress. Your best (fewest moves) result is saved separately for each board size.

A reliable method for solving

You don't need to be a genius to solve a sliding puzzle; you need a plan. The standard approach is to solve the puzzle one row and one column at a time, shrinking it until only a 2 × 2 corner is left.

  1. Solve the top row. Place tiles 1, 2 and so on into place one at a time. The last tile of the row is the tricky one: move it directly below its target first, then use a short loop to swing the row's second-last tile out of the way and drop both in together.
  2. Solve the left column the same way, for example 5, 9 and 13 on a 4 × 4 board.
  3. Repeat on the smaller puzzle that's left: the second row, then the second column, and so on.
  4. Finish the last 2 × 2 by rotating the three tiles around the gap until they fall into place.

Once you've learned the method, a 3 × 3 takes a couple of minutes and a 4 × 4 not much more. To chase low move counts, start thinking about moving several tiles at once and avoid undoing your own moves.

Is every puzzle solvable?

Here, yes, always. Instead of placing tiles randomly, the game shuffles by making hundreds of random legal slides from the solved position, so it can always be undone. That matters: if you took the tiles out of a real puzzle and put them back at random, there's an even chance it would be impossible to solve. The reason is a neat bit of mathematics called parity, which we explain in Why half of all sliding puzzles can't be solved.

A puzzle craze from the 1880s

The 4 × 4 version, often called the 15 puzzle, swept across America and Europe around 1880. It was so popular that newspapers wrote about people playing it at work and in the street, and prizes were offered for solving an arrangement that, as mathematicians soon proved, could never be solved at all.

Frequently asked questions

Is every shuffle solvable?

Yes. The board is shuffled with random legal moves from the solved state, so a solution always exists.

What is the minimum number of moves?

It depends on the shuffle. Any 3 × 3 arrangement can be solved in at most 31 single-tile moves; 4 × 4 arrangements need at most 80.

How are moves counted?

Each tile that moves one space counts as one move, so sliding a row of three tiles counts as three.