Kaamkoby ICE

15 Puzzle

Slide the tiles into the gap until they read 1 to 15 in order, with the gap in the bottom right corner.

Moves0
Time0:00
Best–

Controls

Keyboard
Arrow keys or W A S D slide a tile into the gap. N shuffles again.
Touch
Tap a tile in line with the gap, or swipe on the board.

Your best score stays in this browser only. Nothing is sent anywhere. The game pauses when you switch tabs.

About the 15 Puzzle

The 15 Puzzle is a sliding tile puzzle from the 1870s. Fifteen numbered tiles sit in a 4 by 4 frame with one square left empty. You can only move a tile into the empty square next to it, and the goal is to put the tiles back in order: 1 to 4 on the top row, 5 to 8 on the second, and so on, with the gap in the bottom right corner. It caused a craze in the United States and Europe in 1880, and it is still a standard example in computer science courses on search and problem solving.

Not every arrangement of the tiles can be solved. Exactly half of all possible layouts can never be put in order, however long you try. The famous version with 14 and 15 swapped is one of them. Every shuffle on this page is checked before you see it with a parity test, the same test mathematicians used to prove that the impossible half is impossible. So every game here has a solution.

How to play the 15 Puzzle

  1. Press New shuffle for a fresh board. The clock starts on your first move.
  2. Tap or click any tile in the same row or column as the gap. It slides into the gap, and any tiles between them slide along with it.
  3. Or use the arrow keys (or W, A, S and D). The key names the direction a tile moves, so Left slides the tile to the right of the gap leftwards.
  4. On a phone you can also swipe on the board in the direction a tile should move.
  5. Every tile that moves counts as one move. Tiles that are already in their home square turn green. Solve it in as few moves as you can; your best is kept in this browser.

A method that always works

Solve the puzzle in layers, and never touch a finished layer again. First put 1, 2, 3 and 4 in the top row. The last two are the tricky pair: bring 3 into the corner where 4 belongs, park 4 directly under it, then slide both across together. Do the same with the second row, 5 to 8. After that only a 2 by 4 area is left, and you work column by column: place 9 and 13 together in the left column, then 10 and 14, and finish by cycling 11, 12 and 15 around the last square.

A computer can find the shortest solution with a search called A star, and no starting position on a 4 by 4 board needs more than 80 single-tile moves. A good human solve with the layer method takes around 100 to 200. Aim to get under 150 first, then chase a lower score.

Written from scratch by Imperial College of Engineering for Kaamko. No third-party code or art.

Last checked by Imperial College of Engineering. Played through on desktop and a 390px phone screen on this date.