The 15 puzzle against the computer

The classic 15 puzzle online, against a computer that finds the shortest solution in a blink. Solve it within the move limit to win. Three levels, free, no sign-up.

What this game is

The 15 puzzle is fifteen numbered tiles in a box with room for sixteen. One square is empty, and tiles can only slide into it.

The goal is to put them in order, 1 to 15. The machine playing against you here is of a particular kind: it does not race your fingers, it finds the shortest possible solution in a fraction of a second. You get the same box and must stay within the limit — the shortest solution times your level's margin.

On normal the margin is double, and winning is realistic. On expert it is a quarter on top of a near-random position: a contest against a search that sees dozens of moves ahead.

Rules

How to solve it

A bit of history

The puzzle was invented by Noyes Chapman, a postmaster in Canastota, New York, in the 1870s. In 1880 it became a craze, played in offices, in the street and in session halls. The famous puzzle-maker Sam Loyd later claimed it as his own and told of a thousand-dollar prize for swapping tiles 14 and 15 — a position that cannot be solved.

That had been proved in 1879 by William Johnson and William Story: exactly half of all arrangements are unreachable, and the parity of the permutation decides which. There are 16!/2 reachable positions, about 10.5 trillion. That is why the box here is always scrambled by random moves from the solved state: it is then solvable by construction.

For machines the 15 puzzle became the classic search problem. In 1985 Richard Korf introduced the IDA* algorithm and found optimal solutions to random positions for the first time. In 1999 it was proved that any position can be solved in at most 80 moves — the puzzle's "God's number".

About the levels

Normal: scrambled by 24 random moves, limit twice the shortest solution. A careful row-by-row solve usually fits.

Hard: 50 random moves, limit one and a half times the shortest. You have to think several tiles ahead.

Expert: 150 random moves — a near-random position whose shortest solution is usually around 45 to 50 moves — and a limit only a quarter longer. The computer pays under a second of search for it; a human, a very good game.

Where to go from here