Sliding Tile Puzzle
The empty square is the only space a tile may enter. This browser puzzle starts from an ordered board and scrambles it through legal slides, so every generated board is reachable. The optional hint searches for a shortest solution using Manhattan-distance IDA* within a strict node, time and depth budget; if that budget runs out, the answer remains unknown rather than being labeled impossible.
Key features
- Reproducible seeded 3×3, 4×4 or 5×5 boards generated only by legal adjacent slides
- Strict one-tile adjacency validation, goal detection, undo and reset
- Keyboard or touch controls with a highlighted movable neighbor and explicit win state
- Bounded optimal-path hint with honest unknown result if search limits are reached
- Local JSON report of seed, initial/current boards and every player move
How to use
- Choose a grid size, scramble step count and integer seed, then create a puzzle.
- Click a tile bordering the blank, or focus it and press Enter; arrow keys can also slide a tile into the blank.
- Undo or reset moves, and request a bounded next-tile hint if you need help.
- Restore ascending numbers with the blank at bottom right and save the move record as JSON.
Use cases
- Practice the classic 8-puzzle or 15-puzzle with a reproducible board
- Share a seed so two people can start from the same reachable arrangement
- Inspect the exact move sequence after solving a spatial puzzle
Frequently asked questions
Can a generated board be impossible?
No. Scrambling begins at the solved board and applies only legal neighboring moves. Even-width parity is checked by the model as well.
Are hints always available?
No. The shortest-path search stops at 120,000 nodes, 300 ms or 80 moves. When a bound is reached it reports an unfinished search, not that the board is unsolvable.
Does the scramble count measure difficulty?
No. It counts legal mixing moves, not a proven minimum distance or human difficulty. A rare return to the solved state adds one legal move.
How does the keyboard work?
Focus any numbered tile and press Enter or Space to try to move it. Arrow keys move focus; if the arrow points into the blank, that tile slides.
Does JSON save a solution?
No. It records the exact generated and current board plus your moves; hints are calculated locally on request and are not included.
Privacy
The board, seed, moves and hint search stay in your browser tab. JSON is downloaded only when you request it; no puzzle input is submitted to a server.
Comments & questions