メインコンテンツにスキップ
EverydayToolsシンプル • 無料 • 速い
ホームカテゴリ
検索ツール...
  1. Home
  2. Games
  3. Sliding Puzzle Game
Advertisement
Loading...
Advertisement
Loading...

Arrange the numbered tiles in order — click, tap, or use arrow keys to slide

The Sliding Puzzle is one of history's most enduring logic games, first popularized in the 1870s by puzzle inventor Noyes Chapman and later made famous worldwide by Sam Loyd. The concept is elegantly simple: a grid of numbered tiles sits inside a frame with exactly one empty space. By sliding tiles into the empty space one at a time, the player must rearrange all tiles into ascending numerical order — left to right, top to bottom — with the empty space ending in the bottom-right corner. The three classic sizes each offer a distinctly different challenge. The 8-Puzzle uses a 3×3 grid with eight numbered tiles and one empty space. It typically takes 20 to 30 moves to solve and is ideal for newcomers or for practicing sliding puzzle strategies. The 15-Puzzle, played on a 4×4 grid with fifteen tiles, is the most iconic variant. It was the subject of mathematical study throughout the 19th and 20th centuries and remains the definitive sliding puzzle experience for most players. The 24-Puzzle on a 5×5 grid is genuinely hard — even experienced players often exceed 100 moves — and provides an excellent mental workout. One of the most important mathematical properties of the sliding puzzle is that only exactly half of all possible tile arrangements are actually solvable. Given a random scramble, there is a 50% chance that no sequence of valid moves will ever lead to the solved state. This makes the shuffle algorithm critical: a naive random arrangement is just as likely to be unsolvable as solvable. Our game uses a mathematically guaranteed shuffle method — starting from the solved state and applying hundreds of random valid tile moves — so every puzzle presented to you is always winnable. You will never waste time on an impossible configuration. The game rewards both speed and efficiency. A strong player aims to minimize the number of moves, not just finish quickly. Common strategies include working from the top row down, solving corner tiles before edge tiles, and using known 15-puzzle algorithms such as the row-by-row or column-by-column approach. For the 3×3, experienced solvers can reliably finish in under 25 moves. The 4×4 world record (optimal solution) requires a minimum of 80 moves for the hardest possible scramble, though most human solvers average 60 to 120 moves. Controls are flexible: click or tap any tile that is directly adjacent to the empty space to slide it. On desktop, you can also use arrow keys — the arrow direction moves the empty space, so pressing the Up arrow slides the tile below the empty space upward. On mobile and tablet, swipe gestures are also supported for intuitive play. Your best move count and time for each grid size are saved locally in your browser so you can track your personal records across sessions and challenge yourself to improve. The sliding puzzle is not just a pastime — it has significant applications in computer science and artificial intelligence. The 8-Puzzle is a classic benchmark problem for search algorithms, including A* (A-star) search and iterative deepening depth-first search (IDDFS). Researchers use it to compare heuristics like Manhattan distance and linear conflict. The 15-Puzzle, with 1.3 trillion possible states, is large enough to require sophisticated algorithms to solve optimally. Understanding how these puzzles work gives insight into combinatorial optimization, graph search, and admissible heuristics. Whether you are new to sliding puzzles or a seasoned solver trying to beat your personal best, our implementation provides a clean, fast, and always-fair puzzle experience. There are no unsolvable boards, no timers that disappear, and no ads interrupting your flow. Just the pure logic game that has captivated minds for over 150 years.

Understanding the Sliding Puzzle

What Is a Sliding Puzzle?

A sliding puzzle (also known as a sliding tile puzzle, sliding block puzzle, or N-puzzle) consists of a rectangular frame filled with numbered tiles, with one tile missing to create an empty space. The object is to rearrange the tiles from a shuffled configuration into the correct ascending order by sliding tiles one at a time into the empty space. Unlike standard puzzles where pieces are lifted and placed, sliding puzzles require every move to be a legal slide into the adjacent empty cell — no tile can jump over another or be picked up. The three standard competitive sizes are the 8-Puzzle (3×3), 15-Puzzle (4×4), and 24-Puzzle (5×5), each named after the number of numbered tiles in the grid.

How Does the Solvability Algorithm Work?

Given any arrangement of tiles, the solvability of a sliding puzzle can be determined mathematically by counting inversions. An inversion is a pair of tiles (a, b) where tile a appears before tile b when the board is read left to right, top to bottom, but a has a higher number than b. For odd-width grids (3×3, 5×5), the puzzle is solvable if and only if the total number of inversions is even. For even-width grids (4×4), solvability depends on both the inversion count and the row of the empty tile counted from the bottom. Rather than using this check after random shuffling, our game starts from the solved state and applies hundreds of random valid moves — producing a shuffle that is always solvable by construction.

Why Is the Sliding Puzzle Historically Significant?

The 15-Puzzle caused a global craze in the 1880s, comparable to the Rubik's Cube mania of the 1980s. Newspapers offered cash prizes for solutions, and people carried wooden versions in their pockets. The puzzle became a subject of serious mathematical study when mathematicians proved that exactly half of all configurations are unsolvable — this was a significant early result in combinatorics and group theory. In the 20th century, the 8-Puzzle became a standard test case in artificial intelligence research, helping develop algorithms that now power pathfinding in robotics, video games, GPS navigation, and logistics optimization. Even today, puzzle solving competitions include sliding puzzles as a core event.

Limitations and Tips for New Players

The sliding puzzle can feel frustrating at first because intuitive moves often undo previous progress. A few key tips help new players improve rapidly. First, focus on solving the top row before the bottom rows — once the top row is correct, never disturb it. Second, solve corner tiles using small rotation cycles rather than trying to slide them directly into position. Third, remember that arrow keys move the empty space, not a specific tile — Up moves the empty space upward (sliding the tile below it up). Fourth, the 5×5 puzzle is genuinely difficult and may take many attempts. Starting with the 3×3 builds intuition before tackling the classic 4×4. Finally, reducing your move count matters more than speed — fewer moves means you are solving more efficiently.

How to Play the Sliding Puzzle

1

難易度を選択

Select Easy (3×3, 8 tiles), Classic (4×4, 15 tiles), or Hard (5×5, 24 tiles) using the buttons above the board. The game immediately shuffles to a new solvable configuration for the selected size.

2

Slide Tiles Into the Empty Space

Click or tap any numbered tile that is directly adjacent (up, down, left, or right) to the empty space to slide it. On desktop, use arrow keys — the arrow moves the empty space in that direction. On mobile, swipe on the board to move tiles.

3

Arrange All Tiles in Order

Your goal is to arrange all tiles in ascending order — 1, 2, 3, … across each row from left to right, top to bottom — with the empty space in the bottom-right corner. Tiles with a highlighted border are already in their correct position.

4

Beat Your Personal Best

When you solve the puzzle, your move count and time are saved as your personal best for that grid size. Start a New Game anytime to try again. Challenge yourself to solve with fewer moves each time.

よくある質問

Why is the puzzle always solvable?

Many sliding puzzle implementations shuffle by generating a random tile arrangement, but exactly half of all possible arrangements are mathematically unsolvable — meaning no sequence of valid moves will ever produce the solved state. Our game avoids this entirely by using a construction-based shuffle: we start from the perfectly solved board and apply hundreds of random valid moves. Because every step in the shuffle is a legal slide, the result is always reversible and therefore always solvable. You will never be stuck with an impossible puzzle.

What do the arrow keys do?

Arrow keys control the movement of the empty space, not a specific tile. Pressing the Up arrow moves the empty space upward — which means the tile directly below the empty space slides up into it. Pressing the Right arrow moves the empty space right — so the tile to the left of the empty space slides right. This convention is used by most sliding puzzle implementations and matches the physical intuition of sliding puzzle boards. You can also use W, A, S, D keys as an alternative to arrow keys.

How are move counts and times tracked?

The move counter increments by one each time a tile successfully slides into the empty space. The timer starts the moment you make your first move on a new game and stops when you solve the puzzle. Both are reset to zero when you start a New Game. Your best result (fewest moves, and fastest time if moves are tied) for each grid size — 3×3, 4×4, and 5×5 — is saved locally in your browser's localStorage. These personal bests persist across browser sessions until you clear your browser data.

What strategy should I use to solve the 4×4 puzzle efficiently?

The most effective strategy for the 15-Puzzle is to solve the board row by row, starting from the top. First, place tiles 1 and 2 into their correct positions in the top row, then tiles 3 and 4 together using a specific rotation cycle. Next, solve the second row (tiles 5–8) the same way. Once the top two rows are complete, focus on the remaining 2×4 section, solving column by column from left to right. Tiles that are close to their target positions should be moved there carefully using small cycles that do not disturb already-solved rows. Practicing on the 3×3 first builds the intuition needed for larger grids.

Can I play the sliding puzzle on a mobile phone?

Yes. The game is fully mobile-optimized. On touch screens, simply tap a tile that is adjacent to the empty space to slide it. You can also swipe on the board in the direction you want the empty space to move — swipe up to move the empty space up (sliding the tile below it upward), swipe right to move the empty space right, and so on. The board automatically resizes to fit your screen. For the best experience on small screens, we recommend starting with the Easy 3×3 mode, which has larger tiles and is easier to tap accurately.

What is the minimum number of moves to solve each puzzle size?

The minimum number of moves (optimal solution length) varies by configuration. For the 3×3 (8-Puzzle), the maximum over all configurations is 31 moves (God's number for the 8-Puzzle), but most typical shuffles require 20–25 moves optimally. For the 4×4 (15-Puzzle), the maximum is 80 moves, and average random shuffles optimally require about 52 moves — but most human solvers use 60–120 moves. For the 5×5 (24-Puzzle), finding the optimal solution is computationally expensive; typical human solutions range from 80 to 200+ moves. Improving your move count is a good measure of how well you understand sliding puzzle techniques.

EverydayToolsシンプル • 無料 • 速い

IT専門家でない方のための無料オンラインツール。計算機、変換ツール、ジェネレーターなど。

人気のカテゴリ

  • 健康計算機
  • 財務計算機
  • 変換ツール
  • 数学計算機

会社

  • について
  • お問い合わせ
  • プライバシーポリシーを確認してください
  • サービス利用規約

© 2026 EverydayTools.io. 無断転載を禁じます。