Sliding block puzzle solver
Stuck on an unblock or rush-hour style level? Draw the board below — one letter per block, A for the block that must escape to the right — and the solver returns the shortest sequence of slides. It runs in your browser and lets you step through the answer one move at a time.
Enter your board
Letters = blocks · empty = free cell · # = wall · the highlighted right edge marks the exit.
How the solver works
Every block in an unblock puzzle is locked to one axis, so a position is just the offset of each block along its track. The solver explores positions in breadth-first order — everything one move away, then two, and so on — where sliding a block any distance counts as a single move. Because it never looks at a deeper position before finishing a shallower one, the first time block A reaches the exit is a shortest solution. A typical 6x6 board has a few thousand to a few hundred thousand reachable positions, which a browser checks in well under a second.
Solving by hand: work backwards from the exit
Look at the target row and list every block between A and the exit. For each one, ask which way it has to move to leave that row and what is stopping it. That second list is your real starting point: clear the blocks that trap the blockers, then the blockers, then drive A out. Keep blocks parked at the far ends of their tracks when you can — a block left in the middle of the board is the most common reason a puzzle feels impossible.
Practise on puzzles that are guaranteed solvable
Escape Grid is a free browser sliding block game with 160 hand-checked levels, plus a Daily Challenge. Each level was verified by a solver before release. For numbered tile puzzles instead, use the 15 puzzle solver, and the unblock puzzle guide covers strategy in depth.
Frequently asked questions
- How do I enter my puzzle?
- Give every block its own letter and type that letter into each cell it covers. Use A for the block that has to escape — it must lie horizontally, and it leaves through the right edge of its row. Leave empty cells as a dot, and use # for a fixed wall. The solver works out whether each block moves sideways or up and down from its shape.
- Does it find the shortest solution?
- Yes. It uses breadth-first search, counting sliding one block any distance along its track as one move — the way most unblock and rush-hour style games count. The first solution it reaches is therefore one of the shortest possible.
- Why does it say my puzzle has no solution?
- Usually a block was entered with the wrong shape — two neighbouring blocks sharing a letter, or the target not on the row you meant. If the board is entered correctly, the search has tried every reachable position and none frees the target block.
- Is anything uploaded?
- No. The search runs entirely in your browser, and the board you type is never sent anywhere.