Klotski

Move the generals aside and get Cao Cao out

Offline

Play against bots, no connection needed.

Variant
Layout

How to play

  • Klotski: move Cao Cao (the large 2×2 block) to the exit at the middle of the bottom edge. Pieces can only slide into empty spaces; they can't be lifted or turned.
  • Drag a piece, or tap a piece and then an empty space. Moving a piece anywhere it can reach (one cell, two cells or around a corner) counts as 1 move, and moving the same piece again right after still counts as just 1 move.
  • There are 16 classic layouts, each marked with its minimum number of moves (81 for Sword Across the Saddle). Hint shows the next move of a minimum-move solution.
  • Sliding puzzle: put the scrambled numbers back in order with the empty space in the bottom-right corner. Tap a tile in the same row or column as the empty space, and it slides toward the space along with any tiles in between. Each tile moved counts as 1 move.
  • Both variants offer undo, hints and restarting, and each game lasts up to 60 minutes. This device keeps your fewest moves and fastest time for each layout (and for each sliding puzzle size).

Playing guide

These options and rules describe the current JoyPip version. Choose a mode above before starting; rules are also available during play.

Worked examples and tips

In Sword Across the Saddle, only the two middle cells of the bottom row start empty. Move the left soldier directly below Guan Yu down one cell, and the best solution needs 80 more moves. If it moves down and then turns right into the other empty cell, that still counts as 1 move, but 81 moves remain afterward, so the move was wasted.

Practice options

Variant
Klotski · Sliding puzzle
Layout
Sword Across the Saddle · Calm Command · Generals Crowd the Camp · Side by Side · Three-Pronged Attack · Pattering Rain · Flanking Troops · In the Peach Garden · Onward March · Smooth Sailing · Surround, Don't Strike · Fleet of Foot · Nowhere to Fly · Horse Bars the Pass · Layered Defenses · Winding Mountain Path
Board size
3×3 · 4×4 · 5×5

Detailed rules and controls

Controls
  • Drag a piece to where you want it and release, or tap a piece and then an empty space inside a dotted frame. A piece with only one possible destination moves there with a single tap.
  • Keyboard: Tab selects a piece, arrow keys move it one cell, Esc cancels the selection. In the sliding puzzle, arrow keys slide the tile next to the empty space in the arrow's direction.
  • Hint highlights the piece to move and where it goes; tap the highlighted piece again to make that move.
Moves and hints
  • Klotski uses the traditional move count: moving a piece one cell, two cells or around a corner counts as 1 move, matching the well-known minimum move counts.
  • In the sliding puzzle, each tile moved counts as 1 move: sliding three tiles at once counts as 3.
  • On 3×3, hints follow an optimal solution. On 4×4 and 5×5, hints solve the rows first and then the columns; this always works but may not take the fewest moves.
  • In Klotski, "Restart" returns to the start of the layout; in the sliding puzzle, "New puzzle" scrambles the tiles again.

Frequently asked questions

Do I need a download or a linked email?

Play directly in your browser without a download. Linking email is an optional way to recover your account. Before clearing browser data, consider whether you need to keep your account or local records.

Do matches earn or spend coins?

Earn coins by checking in and spend them on cosmetics. Matches never cost or award coins.

Report a problem

Try these related games