Sliding Puzzle challenges you to arrange scrambled numbered tiles in ascending order. The 4x4 grid contains 15 numbered tiles and one empty space. You can slide any tile adjacent to the empty space into that space, gradually moving tiles to their correct positions. The tiles are scrambled randomly at the start of each game using an algorithm that guarantees solvability. Not all tile permutations are solvable in a sliding puzzle — only half of all possible arrangements can be solved. Our shuffling algorithm ensures that only solvable permutations are generated, so every game can be completed with the correct sequence of moves.
The sliding puzzle has a rich history: it was invented in 1874 by Noyes Chapman and became a worldwide craze in the 1880s. The mathematical theory behind it involves permutation parity: a solvable puzzle must have an even number of inversions (pairs of tiles in the wrong order). We calculate this parity during shuffling and adjust the arrangement if necessary to ensure solvability. The game tracks your total moves and elapsed time, and saves your best performance (fewest moves to solve) in localStorage. The optimal solution for a scrambled 15-puzzle typically requires between 50 and 80 moves. Professional solvers can complete any solvable puzzle in under 100 moves using the "fringe method" — solving the top two rows first, then the bottom two rows using a specific algorithm. The game uses HTML5 Canvas for rendering, with smooth slide animations that make tile movements feel fluid and responsive.
Controls
Click/TaporArrow Keysto play
Strategy Guide
Sliding Puzzle challenges you to rearrange scrambled numbered tiles into ascending order. The 4x4 puzzle has exactly one empty space (the "hole") used to shift tiles. The optimal strategy is the reduction method: solve rows 1-2 from top to bottom, then solve the remaining 3x4 as a smaller puzzle. The bottom two rows are the hardest because you have less space to maneuver. A puzzle is unsolvable if the number of inversions (a tile preceding a smaller tile) plus the row number of the empty space is odd — the game always generates solvable scrambles, but understanding this helps diagnose frustration. The average solve time for a 4x4 puzzle is 2-5 minutes. The 5x5 mode (requires 25 tiles) takes 8-15 minutes. The algorithm for moving a tile into a specific position without disturbing solved tiles uses a 3x2 or 2x3 rotation pattern.
Play Tips
The reduction method for 4x4 puzzles: solve the top row first (tiles 1-4), then solve the second row (5-8) without disturbing the first row. The bottom two rows (9-16) require a different technique called "column solving" where you solve the third column (9 and 13), then the remaining bottom-right 2x2 can be rotated into place. The key: never move a solved tile out of position unless you can restore it within 2-3 moves. Each extra move that disturbs a solved tile adds approximately 15 seconds to total solve time.
Technical Note
Technical note: puzzle solvability is verified using inversion count parity: a 4x4 puzzle is solvable if the number of inversions (a tile appears before a smaller tile) plus the row of the empty space (0-indexed from bottom) is even. The shuffle algorithm applies 200 random valid moves from a solved state rather than random tile placement, guaranteeing solvability. The move animation uses CSS transform with 150ms transition timing.