15 Puzzle Game

Press the box to change or use the arrows of the keyboard

History of the 15 Puzzle

Invention (1874–1879)

  • The sliding puzzle concept was first described by Noyes Palmer Chapman, a postmaster from New York, in 1874.
  • Initially, smaller versions (like 8-puzzle on a 3×3 grid) circulated.

Commercial Success (1879)

  • Around 1879, the 15 Puzzle became a massive craze in the United States and Europe.
  • It was typically sold as a small handheld frame with 15 square tiles numbered 1 through 15 that could slide around in a 4×4 tray with one empty space.
  • Sam Loyd, a famous American puzzle creator, later falsely claimed to have invented it and popularized it by offering a reward for solving a particular unsolvable configuration (swapping tiles 14 and 15).

Mathematical Importance

  • Mathematicians studied the puzzle extensively in the late 19th century.
  • It became an important early example in group theory and permutation puzzles, because only half of the possible arrangements are solvable.

Modern Popularity

  • The 15 Puzzle remains popular as a toy, brain teaser, and app on phones and computers.
  • It inspired many other sliding-tile and state-space puzzles, including AI research (the famous A* search algorithm was first demonstrated on sliding puzzles).

Rules of the 15 Puzzle

Setup

  • The puzzle is a 4×4 grid with 16 spaces.
  • 15 numbered tiles (1–15) occupy the grid, and one space is left empty.

Objective

The goal is to arrange the tiles in numerical order from 1 to 15, left to right and top to bottom, with the empty space in the bottom-right corner:

                1   2   3   4
                5   6   7   8
                9  10  11  12
                13 14  15  [ ]
            

Moves

  • You may slide an adjacent tile (up, down, left, or right) into the empty space.
  • No jumping or diagonal moves allowed.

Solvability Rule

  • Not all scrambled positions can be solved!
  • A configuration is solvable only if the permutation of tiles has the correct parity (an even number of inversions).
  • That’s why Sam Loyd’s infamous challenge (swap tiles 14 and 15 only) is impossible.