Swap Tiles through a Single Empty Space
Move only a tile that shares a side with the blank. Track the blank, avoid repeated states, and discover whether the worked example’s 17-move route is merely successful—or truly shortest.
One blank controls every move
At any moment, only tiles directly above, below, left, or right of the empty cell may slide. The blank then moves into the tile’s old position.
original puzzle at a glance
The worked example starts with the board 5 □ 1 / 4 3 2. It asks only that tiles 1 and 2 exchange places; the final positions of 3, 4, and 5 do not matter.
Separate fixed targets from “anywhere” tiles
Four original rules
Checkpoint
Move the blank by sliding a neighbor
Click a numbered tile. Only side-neighbors of the blank can move.
Live move audit
Checkpoint
How many legal first moves are available from the worked example starting board?
Track the first five moves
original opening sequence
Checkpoint
Replay the complete 17-move construction
Move-by-move route
| Step | Moved tile | Board state |
|---|
Checkpoint
Use undo, avoid loops, and reach the swap
Goal: tile 2 at top right and tile 1 at bottom right. Other pieces may finish anywhere.
Your route
Validate your construction
Undo removes a move from the current route and its repeat count; Redo restores it. The remaining-distance display counts additional moves from the current board, not moves already spent. Your route may differ from the worked example and may use more than 17 moves. It succeeds when the two target tiles have exchanged their starting positions.
Follow the blank and recognize a loop
Reason it through
A corner blank has two side-neighbors. A middle blank has three. Sliding a tile into the blank and straight back uses two moves but returns to the same board. Keep the first useful state and revise the branch instead of repeating that loop.
All written arrangements
The board holds six objects: tiles 1–5 and the blank. If we ignore legal-move reachability, they can be arranged in:
The complete search below visits 360 boards reachable from this start—half of the 720 written arrangements:
Distance from the starting board
A state is one arrangement of the tiles and blank. A distance layer groups all boards whose shortest route from the starting board takes exactly that many moves. Layer 0 contains just the starting board. Layer 1 contains its three immediate neighbors. A board reached again by a longer route is still counted only in its shortest-distance layer.
Checkpoint
Distinguish a working route from a shortest route
Reason it through
A working 17-move route proves that 17 is enough. To prove it is shortest, every route with 0 through 16 moves must fail. Just one shorter successful route would disprove the claim. The optional search below checks all boards at distance 0, then 1, then 2, and so on. Each distance is the fewest moves needed to reach that board from the start. Use this after finding a route to understand why a shorter one cannot work.
Check boards in order of shortest distance
The two first-arriving goal states
Checkpoint
Track your route while revising a plan
Reason it through
After six slides, undoing the last one leaves five moves in the current route. Only tiles 1 and 2 have fixed targets in this puzzle. The other three tiles may move temporarily or finish elsewhere. The optional experiment below starts a new puzzle when you choose a different pair of tiles to exchange. Its minimum and route counts belong to that selected pair. Your original construction still asks you to exchange tiles 1 and 2.
Choose two tiles to exchange
Checkpoint
Sliding-puzzle workshop
Explain what makes the route valid and optimal
Sliding-State Pathfinder
Awarded to Puzzle Solver for building a legal tile swap, tracing the worked example’s route, and using a complete state-space audit to certify the 17-move minimum.