N-Puzzles — Grid Puzzle Games

The 15 Puzzle is the original sliding-tile game: fifteen numbered tiles, one empty cell, and a simple demand — put the numbers back in order. Tiles can't be lifted; they can only slide into the gap. It looks easy. It is not. And it once drove the whole world slightly crazy.

This app gathers the whole family under one roof: the classic 4×4 alongside smaller 8- and 11-tile boards and larger 19- and 24-tile grids, triangular boards where a tile flips across its shared edge into the gap instead of sliding, and hyperbolic boards where the ring around the middle holds twelve tiles instead of eight. Same demand every time — get the numbers back in order.

Where it comes from

The puzzle appeared around 1874, credited to Noyes Palmer Chapman, a postmaster in New York State. By 1880 the "Fifteen Puzzle" was a full-blown mania in America and Europe — newspapers wrote about employers banning it from offices. Its most famous story is a trick: the puzzle showman Sam Loyd claimed he had invented it, and offered $1,000 to anyone who could solve a version where only the 14 and 15 were swapped. His money was perfectly safe — that position is impossible, and mathematicians had already proved it.

How to play

Tap any tile next to the empty cell and it slides in — or drag a tile, or select one and nudge it with the arrow keys or WASD; tiles flow through the gap. (On a triangular board, a tile beside the gap flips across the shared edge into it.) You win when the tiles read back in order. Solve it in layers: finish the top row first, then the left column, and never touch them again — the rest becomes a smaller, easier puzzle. The last two rows are the tricky part: you must rotate tiles in pairs around the gap. Every shuffle you are dealt is solvable, and Hint will show a good next move whenever you are stuck.

The math

Why was Loyd's $1,000 safe? Every slide swaps the gap with one tile, and if you track the swaps carefully, a hidden pattern — called parity — never changes. Exactly half of all possible arrangements can reach the solved picture; the other half, including Loyd's 14–15 swap, can never get there, no matter how long you try. This app shuffles by actually sliding tiles randomly from the solved board, so your start is always on the solvable side.

The solvable half is still enormous — about ten trillion positions, and the very worst ones need 80 moves. Computers cracked the puzzle by being smart, not fast: the Hint search estimates how far each tile is from home (walking distance, no diagonals — the "Manhattan distance," like walking city blocks) and explores the most promising moves first. The little 3×3 version of this idea is the first search problem many computer scientists ever study.