Warden

A guard walks a fixed route and never once varies it. Getting past him is a matter of learning the pattern and timing your own moves to it, rather than reacting quickly.

How to play

Nothing moves until you do: you take one square, then the warden takes one square towards you along a shortest route through the corridors.

  1. Watch the gap The scoreboard shows how many corridors away he is. Walking away in a straight line never changes it — he moves at your speed.
  2. Move or wait Tap a neighbouring square, use the arrow keys, or press space to hold still.
  3. Use the pillars A wall he has to walk round is the only thing that gains you ground. Look for a route where his shortest path is longer than yours.
Full instructions

In depth

Outsmarting a Perfectly Predictable Pursuer

This article covers the rules, controls, and winning strategies for Warden, a pursuit-evasion puzzle where the chaser always takes a shortest route to your current square. His total predictability is your only advantage, and learning to exploit it is the whole game.

Screenshot: How to play Warden
How to play Warden as it appears when the page opens.

What the game is about

You are placed inside a grid of corridors and walls. Somewhere on the grid is a green gate, and somewhere else is the warden. You move one square at a time, and after every move you make, the warden moves one square toward you along a shortest path through the corridors. If he ever lands on your square, you are caught and the game is over. Your goal is to reach the gate before he reaches you, and before your move budget runs out.

The warden never guesses where you plan to go. He does not try to cut you off or predict your route. He simply walks toward the square you are standing on right now, by the shortest available path. That mechanical behaviour is what makes the puzzle solvable. If he were smarter, most boards would be impossible. Because he is not, there is always a way out.

Movement rules in full

You may step to any neighbouring open square in the four compass directions. You cannot walk through walls, and you cannot step onto the warden's square. The game refuses that move outright rather than letting you lose by accident. You can also stand still by pressing Space, but standing still is not free. It costs you one move from your budget, and the warden still takes his step toward you.

After your move, the warden steps one square toward you along a shortest corridor path. When two or more paths are equally short, he picks the one with the lower square number, which means up and left before down and right. He never takes a longer route, never pauses, and never varies. Every move he makes is forced by those two rules, so you can predict his position after any sequence of your own moves.

Controls

On a phone or tablet, tap any neighbouring square to move there. On a desktop, you can also use the arrow keys or the W, A, S, D keys. Press Space to stand still for one turn. The New game button below the board generates a fresh prison. The Prison dropdown lets you choose Small, Medium, or Large before starting.

How scoring works

Your score is the number of moves you use to escape. Lower is better. The scoreboard shows the fastest possible escape, labelled Fastest escape, and the game tracks your personal best across sessions. If you reach the gate in fewer moves than your previous record, the new count replaces it.

You have a limited budget of moves. This budget is the fastest-escape count plus a small allowance for mistakes. If you run out of moves before reaching the gate, the game ends with a lock-up result. The allowance is a few moves on Small and Medium prisons and slightly tighter on Large ones.

Reading the scoreboard

Three numbers sit above the board. Warden away tells you how many corridor squares separate the warden from you right now. If you walk in a straight line away from him, this number does not grow, because he matches your speed exactly. Moves left counts down from your budget. Fastest escape is the shortest route that actually works, considering both your position and the warden's at every step. It is not just the shortest path to the gate. It is the shortest path that avoids getting caught along the way.

Using walls to gain ground

Walking away in a straight corridor is pointless. The warden moves at your speed, so the gap never changes. The only way to gain ground is to put a wall between you and him that forces his shortest route to be longer than yours. A pillar in the middle of a corridor is the classic example. You can duck around one side while he has to go around the other, and every square of wall he has to circle costs him a move that you do not spend.

Before you commit to a direction, look at the shape of the walls near you. Ask yourself: will his shortest route to me go around this wall the long way? If so, that is your opening. If his route and yours are the same length, you gain nothing and may lose your position.

The waiting trick

Standing still is usually a waste of a move, but there is one situation where it is the right play. If the warden is approaching a fork, you can wait for him to commit to one side and then step to the other. This is easiest near a pillar. Suppose you are on one side and he is approaching the corner. If you move too early, his shortest route may adjust. If you wait, he steps closer on his current path, and then you go the other way.

This technique costs you one move for the wait, but it can gain you two or three moves of distance if the wall is thick enough. The help section on the page calls this the classic escape, and it works because the warden never anticipates. He always walks toward where you are, not where you are going.

Tie-breaking at close range

When two routes to your square are equally short, the warden always takes the one with the lower square number. Squares are numbered from left to right, top to bottom, so the lower number means up and to the left. At close range, where one wrong step catches you, this knowledge matters. If you know which of two corridors he will choose, you can take the other one.

This tie-break rule is deterministic and never changes. If you replay the exact same sequence of moves on the same board, the warden will follow the same path every time. That is the foundation of the entire puzzle: the warden is a machine, and machines can be outrun if you know their rules.

Common beginner mistakes

The most common error is running straight for the gate without thinking about the warden's path. If the gate is far away and the warden is between you and it, a direct run often ends in capture. Take a moment at the start to trace his likely path and plan a route that uses at least one wall to shake him.

  • Running down a dead end is fatal. A corridor with one way out traps you the moment the warden enters it. Always check that you have a second exit before going in.
  • Standing still repeatedly burns moves without gaining anything unless you are using it to set up a pillar trick. Each wait lets him close by one square.
  • Ignoring the gap indicator. If the warden-away number is shrinking, you are being caught. Change direction immediately.
  • Trying to reach the gate on the last move. The gate check happens before the warden's reply, so you do survive a simultaneous arrival, but cutting it that fine means one wrong step anywhere earlier ends the game.

Difficulty levels

The Prison dropdown offers three sizes. Small uses a six-by-six grid with fewer walls. The warden starts several squares away, and you have a generous move allowance. It is a good place to practise the pillar trick without much pressure. Medium uses a seven-by-seven grid with slightly more walls and the same move slack. Large uses an eight-by-eight grid with more walls and a tighter move allowance. The bigger the grid, the longer the escape routes and the more walls you have to read, but the tighter budget means you cannot afford as many wrong turns.

Every board is generated fresh and checked by an exhaustive search before it is offered. The search considers both your position and the warden's at every step, which is why the fastest-escape number is reliable. If the search finds no escape, the board is discarded and a new one is built.

Privacy and your device

The entire game runs inside your browser. No data leaves your device, no account is needed, and your best score is stored in local browser storage only. It will not follow you to another device or another browser on the same machine. Once the page has loaded, the game works without an internet connection.

Help

How to play Warden

Nothing moves until you do: you take one square, then the warden takes one square towards you along a shortest route through the corridors. Standing still counts as a move and spends one, which is sometimes the only way to change which corridor he comes down. Reach the green gate before your moves run out, and never let him land on your square.

Watch the gap

The scoreboard shows how many corridors away he is. Walking away in a straight line never changes it — he moves at your speed.

Move or wait

Tap a neighbouring square, use the arrow keys, or press space to hold still.

Use the pillars

A wall he has to walk round is the only thing that gains you ground. Look for a route where his shortest path is longer than yours.

Reach the gate

Touching it wins immediately — he does not get a reply.

Why the search uses both positions

It would be natural to search only over where you are, and it would be wrong. A square that is perfectly safe with the warden on the far side of the prison is fatal with him next door, so the state that has to be searched is the PAIR of positions. That is what the generator does: a breadth-first search over every combination of your square and his, stepping him with exactly the rule the game uses, so the escape it finds is one you can genuinely walk. Prisons with no escape are thrown away, as are ones where he starts too close to be worth avoiding.

Good to know

He never anticipates

He walks toward where you ARE, not where you are going. Doubling back round an obstacle costs him two moves and you none.

Ties break to the lower square

When two routes are equally short he takes the one with the smaller square number — up and left before down and right. That is worth knowing at close range.

Do not run down dead ends

A corridor with one way out is fatal the moment he enters it. Check your escape before you commit.

Waiting can be right

Letting him commit to one side of a pillar and then going the other way is the classic escape.

Common questions

Does he ever guess where I am going?
No. He always takes a shortest route to your current square, which is what makes him beatable.
Can I walk into him?
The game will not let you — it is simply a losing move.
Does he move if I stand still?
Yes. Waiting costs you a move and gains him one.
Is the escape always possible?
Always. Every prison is searched before it is offered.
What if I reach the gate at the same moment he reaches me?
Reaching the gate is checked first, so you get out.