No — in Klotski, no piece ever rotates, and no piece ever moves more than one orthogonal cell at a time. Every rectangle in this original sliding-block puzzle keeps its disclosed width and height for the entire game. Each accepted action shifts a selected piece by exactly one cell horizontally or vertically. If the candidate footprint would extend outside the 4 by 5 board or overlap any other piece, the move is rejected atomically: positions, history, move count, score, selection, and completion all stay exactly as they were. The rule is built into the engine as an explicit footprint check that runs before any new state is installed. That single mechanical rule is what separates Klotski from a tetromino packer and from a freeform grid where you could nudge a piece two or three squares, and it is also the reason the puzzle's shortest solution can be expressed as a sequence of atomic one-cell steps that anyone can audit by hand.

can pieces rotate or move more than one cell when i play klotski
can pieces rotate or move more than one cell when i play klotski

What an atomic one-cell move actually does

Every successful move in Klotski is a single step along the grid's coordinate system, where columns run from 0 through 3 and rows run from 0 through 4. A 2 by 2 goal block, for instance, occupies a 2 by 2 footprint of cells; when you press the Down arrow, that footprint shifts down by one row, not two, three, or four. The engine builds the full destination footprint first, then checks whether every cell in that footprint lies inside the board and whether any of those cells are already occupied by another piece. If either condition fails, the move is silently refused and the visible board does not flicker, animate, or shake — the candidate move simply never happened.

This atomic semantics has two practical consequences for the player. First, you never have to wonder whether a long press or a drag will leap a piece across the board; the rules forbid it. Second, the rule makes every accepted move a verifiable event in the move history, which is the foundation for safe Undo and for the independent breadth-first search proof that the puzzle is solvable in exactly six moves.

The fixed footprints you cannot change

The Klotski board contains exactly six rectangles with disclosed sizes and disclosed starting coordinates. Their dimensions never change, no matter how many moves you make.

Piece ID Name Size Starting position (x, y)
1 Goal 2 by 2 (1, 0)
2 Left pillar 1 by 2 (0, 0)
3 Right pillar 1 by 2 (3, 0)
4 Slider 1 by 1 (1, 2)
5 Guard 1 by 1 (0, 2)
6 Gate 1 by 1 (2, 2)

The two 1 by 2 pillars are different rectangles with different positions, not reflections of each other; you cannot rotate either pillar to swap its width for its height. The 2 by 2 goal block is the only large rectangle on the board, and its footprint stays 2 by 2 for the entire game. The three 1 by 1 blocks (Slider, Guard, and Gate) all share the same dimensions, but they are distinct pieces with their own identities, and the engine tracks them by ID, not by appearance.

Altogether these six rectangles cover 11 of the 20 cells in the 4 by 5 board, leaving 9 empty cells available for movement. The objective is to move the goal's top-left corner from (1, 0) to (1, 3), so that the 2 by 2 footprint fills columns 1 and 2 of the bottom two rows and exits through the disclosed two-column opening centered along the bottom edge. Because every move shifts a piece by exactly one cell and never rotates it, reaching that exit requires a minimum of six accepted actions, and the route that achieves it is provably unique in length.

How to play Klotski in your browser

If you want to put these rules into practice, the entire puzzle runs locally in your browser at the Klotski page. The three-step loop below describes everything you actually do.

  1. Select one of the six disclosed rectangles by tapping it on the board or pressing its number key from 1 through 6. Pressing 1 selects the 2 by 2 goal; pressing 2 selects the left pillar; 3 selects the right pillar; 4 selects the Slider; 5 selects the Guard; and 6 selects the Gate. The selected piece gains a visible outline and its name appears in the status area.
  2. Move the selected piece one cell with the direction controls or the arrow keys. Up, Down, Left, and Right each attempt exactly one cell of travel in that direction. If the resulting footprint stays inside the board and does not overlap any other piece, the move is accepted, the move count increments by one, and a snapshot of the previous position is appended to the Undo history. If the move is illegal, the position, history, move count, score, and selection all stay exactly as they were — you can keep trying without losing your place.
  3. Clear the central lane and move the 2 by 2 goal to the two-column bottom opening for exactly 1,000 points. Use Undo whenever a legal experiment blocks another route; Undo restores the previous position from a deep-copy snapshot and decrements the move count by one, so exploration is risk-free.

Reaching the exit is terminal: the winning move sets the score to exactly 1,000 and freezes piece selection, movement, and Undo. To play again, use Restart, which restores all six original positions, reselects the goal, empties the history, resets the move count to zero, and returns the score to zero.

Why the shortest solution is exactly six moves

Because every piece moves by exactly one cell and never rotates, the entire state space can be flattened into integer coordinate vectors and explored with a breadth-first search. The Klotski implementation runs an independent BFS that does not call the production move or collision helpers. For each dequeued state, it builds its own 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 previously unseen coordinate vector once.

The first winning state — meaning the goal's top-left corner sits at (1, 3) — dequeues at depth six. By that point the BFS has discovered 3,234 unique states and expanded 1,470 queue entries. Because BFS explores every state of depth five before any state of depth six, the dequeuing of a winning state at depth six is a direct proof that 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. You can follow it directly if you want to see the 1,000-point finish, and it also illustrates why the one-cell rule 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. None of these six moves is a slide across multiple cells; each is a discrete, reviewable action.

Touch controls, keyboard shortcuts, and Undo

Both input methods are complete, so you can play with a mouse, a touchscreen, or a keyboard alone. On the board, tapping any rectangle selects it and lights its outline; tapping one of the four large direction controls then moves the selected piece one cell. The selector buttons beside or beneath the board mirror the on-board pieces and accept keyboard focus.

Keyboard controls mirror touch exactly. Press number keys 1 through 6 to select Goal, Left pillar, Right pillar, Slider, Guard, or Gate in that disclosed order. Arrow keys attempt one-cell movement in the corresponding direction. Press U, Delete, or Backspace to undo the most recent accepted move. Repeated keydown events are ignored while a key is held, so a long press on an arrow cannot race a piece through several unreviewed states.

Undo is built 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. Because illegal moves never create history entries, you can experiment freely without polluting the timeline. If you ever want a fresh start, the Restart control returns all six pieces to their disclosed starting coordinates, reselects the goal, empties the history, resets the move count, and returns the score to zero — without uploading any board state, move history, or interaction data from your browser.