Klotski
Slide six original rectangles across a compact 4 by 5 board and guide the 2 by 2 goal through a disclosed bottom opening in a proven six moves.
Privacy: your files never leave your device. All processing happens locally in your browser.
How to use
- 1.Select one of the six disclosed rectangles by tapping it or pressing its number key from 1 through 6.
- 2.Move the selected piece one cell with the direction controls or arrow keys; use Undo whenever a legal experiment blocks another route.
- 3.Clear the central lane and move the 2 by 2 goal to the two-column bottom opening for exactly 1,000 points.
About Klotski
Klotski Puzzle is a compact sliding-block challenge built from an original Lizely fixture rather than a copied historical arrangement. The board has four columns and five rows. Six fixed rectangles begin in disclosed positions, including a 2 by 2 goal block, two 1 by 2 pillars, and three 1 by 1 blocks. Select one piece and move it exactly one cell at a time. The objective is to place the goal at the two-column opening centered along the bottom edge.
The coordinate system is explicit. Columns run from zero through three and rows run from zero through four. The goal begins at x=1, y=0. The left pillar begins at x=0, y=0, and the right pillar begins at x=3, y=0. Slider starts at x=1, y=2; Guard at x=0, y=2; and Gate at x=2, y=2. The target places the goal's top-left corner at x=1, y=3, so its 2 by 2 footprint occupies columns 2 and 3 in the bottom two rows.
Every move is atomic. A rectangle keeps its disclosed width and height, never rotates, and changes by one horizontal or vertical cell. Before accepting a move, the logic constructs the complete destination footprint. The footprint must remain within the 4 by 5 board and must not contain a cell occupied by any other piece. If either condition fails, nothing changes: positions, history, move count, selected piece, score, and completion all remain exactly as they were.
The initial board is valid and auditable. The six pieces occupy 11 distinct cells, leaving nine empty cells available for movement. All positions use integer coordinates. No footprint extends outside the board, no two pieces overlap, every declared piece ID appears once, and the goal is the only 2 by 2 rectangle. The bottom opening is marked visually beneath the two central columns and described in text for nonvisual navigation.
The optimum is proven by an independent breadth-first search. The oracle does not call the production move or collision helpers. It stores each state as a flat coordinate vector in the published piece order. For each dequeued state it independently fills an occupied-cell set for the five other pieces, tries Up, Down, Left, and Right for every rectangle, rejects out-of-bounds or colliding footprints, and enqueues each unseen coordinate vector once.
The first winning state dequeues at depth six. At that point the BFS has discovered 3,234 unique states and expanded 1,470 queue entries. Therefore no route of zero through five atomic moves can reach the opening. One shortest path is Slider down, Slider left, Gate right, then Goal down three times. The test executes those exact six moves through production state transitions and validates every intermediate board.
The path illustrates why one-cell accounting matters. Slider first drops into row four and then shifts to the leftmost column, clearing the goal's lower-left lane. Gate shifts right into the open fourth column, clearing the lower-right lane. With both central cells free, the 2 by 2 goal can move from y=0 to y=1, then y=2, then y=3. The final move fills the disclosed exit footprint and awards exactly 1,000 points.
Undo is based on immutable snapshots. Every accepted move appends a deep copy of the previous position map before installing the new one. Undo removes the newest snapshot and restores its exact coordinates, reducing the move count by one. Illegal moves never create history entries. This makes experimentation safe and gives tests a direct way to prove that one move followed by Undo returns to the published starting state.
Pointer controls are complete. Tap any rectangle on the board or its numbered selector button, then use the four large direction controls. The selected piece has a visible outline and is named in the status. Undo one atomic move is a full-width control beneath the direction pad. Every piece, selector, direction, Undo control, move count, status, completion result, and exit marker has stable structure for browser verification.
Keyboard controls mirror touch. Press number keys 1 through 6 to select Goal, Left pillar, Right pillar, Slider, Guard, or Gate in the disclosed order. Arrow keys attempt one-cell movement. Press U, Delete, or Backspace to undo. Repeated keydown events are ignored so holding an arrow cannot race a piece through several unreviewed states. Native piece buttons also remain available to Tab and activate by pointer.
Reaching the exit is terminal. The winning move sets the score to exactly 1,000 and freezes piece selection, movement, and Undo. There is no speed bonus, move penalty, hint cost, partial credit, or random modifier. Restart is the intentional way to replay; it restores all six original positions, selects the goal, empties history, resets the move count, and returns score to zero.
The visual board uses existing site CSS tokens for line, surface, foreground, accent, soft accent, background, and danger states. Piece positioning uses only geometric percentages derived from disclosed grid coordinates; there are no hardcoded color values or remote images. The board is bounded to a narrow maximum width with a 4-to-5 aspect ratio, and controls wrap safely within a 390-pixel viewport without page-level horizontal overflow. Labels and dimensions keep piece identity independent of color.
The shared game shell supplies score, locally stored best score, Restart, and the double-Escape boss key. Press Escape twice within the shell timing window to cover the puzzle with the spreadsheet-style screen, then twice again to return. All search-derived facts and gameplay run locally in the browser. No board state, move history, result, or interaction data is uploaded, and the game needs no account, dependency, remote API, device permission, or paid service.
This is recreational spatial-planning practice, not a standardized intelligence, aptitude, educational, or psychological assessment. The six-move result applies only to the disclosed original fixture and its exact atomic-move definition. It does not claim equivalence with any culturally named layout or external puzzle collection.
Methodology & sources
Define six original axis-aligned rectangles on a 4 by 5 integer grid with immutable dimensions and disclosed starting coordinates. Validate every position map by checking required IDs, integer coordinates, bounds, and a collision-free occupied-cell set. Treat movement as a one-cell candidate footprint and return the identical state on any invalid destination. Independently flatten all coordinates and run a BFS whose own footprint code tries four directions for every piece, deduplicates serialized vectors, and stops when the 2 by 2 goal reaches x=1 y=3. Require the first goal at depth six, 3,234 discovered states, 1,470 expanded entries, and the exact route Slider down, Slider left, Gate right, Goal down three times. Execute that route through production logic, validate every intermediate board, snapshot each legal move for exact Undo, award 1,000 at exit, and freeze all puzzle input after completion.
Frequently asked questions
- Can pieces rotate or move more than one cell?
- No. Every rectangle keeps its fixed footprint, and each accepted action changes its position by exactly one orthogonal cell.
- Is six moves really the minimum?
- Yes. An independent BFS discovers 3,234 states before the first goal dequeues at depth six, proving no path of five or fewer atomic moves wins.
- What happens when a move hits a wall or another piece?
- The move is rejected atomically. Positions, history, move count, score, and completion remain unchanged.
Related tools
- SokobanPush boxes through three deterministic warehouse puzzles with touch controls, full keyboard play, exact undo, and visible corner-deadlock recovery.
- Maze GameGuide the marker through a compact winding maze using only the arrow keys, with blocked moves ignored and a score that rewards the shortest route.
- Pipes PuzzleRotate nine fixed pipe tiles until every opening matches a neighbor and all tiles form one connected network without a closed loop.
- Numberlink PuzzleConnect two pairs of matching numbers with continuous orthogonal paths while avoiding reused cells, overlaps, branches, and wrong endpoints.
- 15 PuzzlePlay the classic 15 puzzle free in your browser β slide the numbered tiles into order with your keyboard, no download or sign-up.
- 2048 GamePlay 2048 free in your browser β merge tiles with your arrow keys to reach the 2048 tile, no download or sign-up.
Mini Games guides
View all- Addition Maze Rules: How to Reach Exactly 19
- Battleships Puzzle Rules: How to Place a 3-Ship Fleet
- How to Play the Dinosaur Game in Your Browser
- How to Play 2048: Quick Start Guide for Beginners | Lizely
- How to Play 15 Puzzle in Your Browser (Quick Start)
- Dinosaur Game Strategy: Score Higher Every Run
- Master 2048 Strategy to Reach the 2048 Tile Every Time
- 15 Puzzle Strategy: Move Sequences That Solve the Board Faster
- Dinosaur Game Rules: How to Play the Chrome T-Rex Runner
- 2048 Rules Explained: How to Play and Win
- How to Play the 15 Puzzle: Rules and Winning Tips