Sokoban forbids both box pulling and double-pushing — a single move can only push exactly one box into an empty floor cell or onto a marked goal. The worker can step through any open floor cell without restriction, but the moment a box occupies the destination, the same input tries to push that single box one extra cell. If the cell beyond is a wall or another box, nothing moves and the move counter does not change. That single rule is what makes warehouse planning feel like planning rather than ordinary pathfinding, and it applies to every legal action in this browser Sokoban, not only to the trickier layouts. The push-only, one-box-at-a-time constraint is the reason a careless push can remove access to a side of the box and trap it against a corner, and it is also the reason a careful route can solve all three fixed layouts with nothing more than four direction inputs and an Undo key. Before you commit to a push, the only question that matters is whether the worker will still be able to stand on the side needed for the next push — and the rest of this article spells out which actions the game accepts, which it silently rejects, and how the recovery controls keep an irreversible push from ruining a run.

What the Push-Only Rule Actually Forbids
The verified Sokoban rules in this browser version allow only one box-moving outcome per action. A box can move only if it is the box directly behind the worker in the direction of travel. There is no "pull" button, no drag gesture, and no diagonal input, so reversing direction never grabs a box the way pulling a cart would. The destination cell behind the box must be in bounds, must not be a wall, and must not be occupied by another box.
| Action the worker tries | Allowed by the rules? | What actually happens |
|---|---|---|
| Step onto empty floor | Yes | Worker moves one cell; move counter increments. |
| Push one box into empty floor | Yes | Both worker and box advance one cell; move counter increments. |
| Push one box onto a marked goal | Yes | Box rests on the goal; the goal is treated as cleared, not as an obstacle. |
| Pull a box from the opposite side | No | Input is treated as a step in the pressed direction; the box stays put. |
| Push two boxes lined up | No | If the second box blocks the destination, the entire push is rejected and nothing moves. |
| Push a box through a wall | No | The wall blocks the push; worker and box remain in place. |
| Push a box into a non-goal corner | Allowed but punished | Move plays, then a corner-deadlock warning pauses further directional input. |
Two practical corollaries follow. First, the worker never moves a box without first standing beside it, which means the route always has to clear the pushing side of the box before committing to the push. Second, a failed push does not waste a turn: when the cell beyond a box is a wall or another box, nothing moves and the move counter does not change.
Why Pulling and Double-Pushing Would Break the Puzzle
Pulling would turn each box into a movable cart and collapse most warehouse puzzles into trivial pathfinding, since the worker could simply reverse every previous push. The push-only constraint is what creates the irreversible commitment that makes Sokoban feel like planning rather than walking. Double-pushing has a similar effect: if one action could shove two boxes, you could clear entire rows in a single step and the level designs would no longer be solvable only through careful positioning.
Because the worker is smaller than a 2x1 footprint of stacked boxes, the rules also need to enforce that the box in front of the worker must have somewhere to go. That single-line, one-cell-ahead check is exactly what the implementation runs on every legal action, so it catches every forbidden outcome — wall, box, or off-grid — before any cell moves. This is also why the same input that pushes a box on a clear floor is silently rejected against a wall: the rule is "advance the box by one cell into a legal destination," and a wall is never a legal destination for a box.
The deterministic three layouts in the browser Sokoban were authored around exactly this rule. Straight Start is a single direct push with no interference; Upper Turn asks the worker to lift a box toward the top wall and then circle around it for the second push; Wall Detour starts with an interior wall between the worker and the first useful pushing position, so the only legal opening move is to walk around that obstruction. None of those layouts could exist if the worker could pull.
How to Move the Worker and Push a Box
The three fixed boards all play the same way: walk beside the box, then push it one cell at a time toward the marked goal. The following steps describe the exact input sequence for a typical push, including the controls accepted by this version.
- Use Arrow keys, WASD, or the four on-screen direction buttons to move the worker one orthogonal cell at a time onto an adjacent floor cell.
- Line up the worker so the box sits exactly one cell in the direction you intend to push.
- Press the same direction again; the worker steps into the box and the box advances one cell into the empty floor or onto the goal.
- Confirm the move counter incremented and the worker is now beside the box on the opposite side, ready for the next push.
- If the cell beyond the box is a wall, another box, or outside the grid, repeat the same input — nothing moves and the counter stays unchanged.
- Continue until the box rests on the centered dot that marks the uncovered goal for that layout.
On a narrow phone the four direction buttons remain available at all times, so the same actions work without swipe gestures. On a keyboard, Arrow keys and WASD are interchangeable, and every legal step produces the same board state regardless of which key you pressed. The on-screen marks are also supported by accessible labels that announce walls, floor, goals, boxes, and the player independently of the visible letters and shapes.
How to Recover From a Corner Deadlock
A box that enters a non-goal corner is flagged as deadlocked, and the implementation pauses directional movement so further pushes cannot make the situation worse. The deadlock check looks at the box's four orthogonal neighbors: if a vertical neighbor and a horizontal neighbor are walls or other boxes in a corner configuration, and the box is not currently resting on a goal, the position is deadlocked. A box resting on an actual goal is excluded from that check because the placement is the win condition, not a trap.
Two recovery paths are always available. Press U or choose the Undo control to restore the exact snapshot of the worker position, box position, and move count recorded immediately before the trapping push. Undo stores literal snapshots rather than reverse-engineering a path, so reversing a push never behaves like a forbidden box pull — it simply rolls the board back to the playable state you were in one move earlier. Press R or use the shared Restart control to return to the first layout of the run; Restart is always available, even when Undo would also work, and it is the right choice when the trapped push happened several moves ago and the earlier snapshots are no longer useful.
Because the corner warning pauses input without erasing the board, the trapping push stays visible and you can see exactly which cell caused the problem. That visibility is what makes the recovery meaningful: you are not guessing what the game thinks happened, you are confirming which push trapped the box.
Score, Levels, and the Fixed Three-Board Run
This Sokoban ships with three deterministic layouts that always reset to the same first board, so the rules are easy to learn and the result is easy to reproduce. Each layout has exactly one box and one goal, which keeps the focus on the push rule instead of visual clutter.
| Level | Layout idea | Points awarded |
|---|---|---|
| Straight Start | Direct push onto the goal with no obstruction | 300 |
| Upper Turn | Lift the box toward the top wall, then circle around for the second push | 300 |
| Wall Detour | Interior wall between the worker and the first pushing position; route begins by walking around it | 400 |
| Completed run total | All three boxes on their goals | Exactly 1,000 |
Points are fixed by level and do not depend on speed, device performance, input method, or animation timing. A cleared intermediate level freezes until you press Next level, and the completed third level freezes permanently until Restart, so a score cannot be awarded twice for the same board by repeated input. The shared game shell stores the best score locally when browser storage is available, which keeps the 1,000-point result stable across sessions on the same device.
How This Sokoban Compares to Other Browser Grid Puzzles
Most grid-based puzzle games on this site accept a wider set of moves than Sokoban. In 2048, swipes merge two equal tiles and never push one tile into a wall. In 15 Puzzle, tapping a tile shifts an entire row or column when the empty slot is adjacent. The defining feature of Sokoban is that the box itself decides whether a move is legal: if the cell ahead of the box is blocked, the worker is also blocked, even though the worker's own destination is empty. That asymmetry — the worker's path is reversible but the box's path is not — is what powers the planning tension in the three deterministic boards.
For readers who want to confirm that these three layouts are product-authored rather than imported from a historical set, the related guide Are These Official or Classic Sokoban Levels? walks through the same source disclosure.
If you're weighing options, Can You Play Sokoban Without Downloading? Yes covers this in detail.