What is Klotski?
Klotski is a sliding block puzzle. A tray is almost completely filled with blocks of different shapes: one large main block, some long ones and some small squares. There is only a little empty space, and the whole puzzle is to use that space to rearrange the blocks until the main block can slide out through the opening. The name Klotski is the one used in the West for this kind of sliding block puzzle (it comes from the Polish word for blocks), and its best-known layout is also called Huarong Road; the origin of the puzzle is disputed. In PsyGames it is called Klotski. In Simon Tatham’s puzzle code it appears under the name Slide, in a folder of unfinished games, so it has no page in the official manual. It belongs to the family of sliding block puzzles that includes the more familiar tile games with numbers on them.
This page explains the rules, the drag control, one way of thinking about it and the habits that stop you going in circles.
The goal and the rules
The rules of the Klotski puzzle are short and strict.
- A block can only be moved by sliding it along the tray into free space next to it.
- Blocks cannot overlap, cannot be lifted off the tray and cannot be rotated.
- A block cannot pass through another block, so the order of moves matters.
- The goal is to free the main block: you win when it leaves the tray through the exit.
In the classic arrangement the tray is 4×5, the main block is a 2×2 square, the exit is a gap at the bottom of the tray, and two cells of the tray are empty. The app generates its boards with Simon Tatham’s code and the app offers no board-size choice. In Tatham’s source the default tray is 7×6 and the presets are 7×6 and 8×6; whether the app keeps the default is not stated, so this is background about the classic puzzle, not a promise about the boards in the app.
How to play Klotski in PsyGames
You play by dragging. Put a finger on a block and drag it into the free space next to it. The block moves if the free space allows it. The app puts the goal in one line: drag a block into the free space and get the main block out. A tap does nothing, only a drag moves a block, and moves are unlimited but counted, so think before you push. A block cannot be dragged to a place where something else sits, so if a drag does nothing, check what is in the way, or whether the free space is big enough for the shape you are moving.
A worked example
The most useful idea in Klotski is that you do not really move blocks, you move the gap.
Suppose a long horizontal block sits directly below the main block and stops it from leaving. To get that block out of the way, it has to clear the cells under the main block, for example by sliding sideways by its full width, and that needs free cells next to it. At the start the free cells are somewhere else. So the first moves have nothing to do with the main block at all. You slide some small block into the gap, which moves the gap one step closer to the blocker. You do it again with another piece. Only when enough free cells touch the blocker can it slide clear, and then the main block can slide down into the space that was opened.
Each of the preparatory moves looks as if it achieves nothing. They do. The position you want is reached by walking the free space around the tray, one block at a time.
Solving tips and common mistakes
- Watch the free space. Always ask where the gap is, where it needs to be, and which blocks it must walk past on the way.
- Know what each shape needs. A single square needs one free cell beside it. A long block sliding along its length needs one free cell at the end. But a long block sliding sideways needs free cells all along its side, and the large square needs free space along a whole side.
- Keep the free cells together when you can. Two neighbouring free cells are much more useful than two separate ones, because they let you move long blocks sideways.
- Do not undo your last move. If you slide a block and then slide it straight back, nothing has changed. Make sure each new move creates a position you have not seen.
- Be ready to move away from the exit. Some positions can only be solved by first moving the main block further from the exit, because that frees space for the pieces blocking it.
- Plan two moves ahead for long blocks. Before shifting a long block, check that the cells it will cover are free all the way, not only the first one.
- Take it step by step. If you feel lost, find one blocker and clear only that blocker, then look again.
How Klotski differs from similar puzzles
In Fifteen there is a single gap, all tiles are the same size and the goal is a particular order. In Klotski the blocks differ in size, which makes the gap’s shape matter, and the goal is just to release one block. Sixteen has no gap at all: whole rows and columns shift and wrap around, which is a different kind of move. Sokoban also asks you to push pieces about on a grid, but there you control a walking figure and push barrels, while in Klotski the blocks are the only things that move.
Klotski in PsyGames
The app lists the Klotski puzzle in its Space hub, together with Sokoban and Galaxies. The rest of the collection is on the all games page.