Traps and Cages: Long Detours Without Illegal Blocks

The rule that you may not seal a pawn off entirely (the rules state it) is tested one wall at a time, against the board exactly as it stands at the moment of placement. It has no opinion about what that wall makes possible on the following turn, and none at all about how long the surviving route is. Those two silences are the whole opening for a cage: a structure of individually legal walls, each one passing the test on its own, that together leave you a twenty-two-square path where you had eight. The check is a promise that a route exists, not a promise that it is worth walking.

What a cage actually is

Stop thinking of a cage as a box and start thinking of it as a room with one door in the wrong place. The walls form a pocket around your pawn; somewhere in that pocket there is a gap, because there has to be; and the whole art is putting the gap as far behind you as possible.

The geometry does some of the work for you here, and it is worth knowing precisely. Walls are two squares long, and the board is nine squares wide. Four non-overlapping walls laid end to end in the groove between two rows block eight of the nine columns — and a fifth will not fit, because it would have to overlap one already down. A straight line of walls across the board can therefore never be completed. The leftover column is the door, and you get to choose where it goes: against the east edge, against the west edge, or somewhere in the middle. Nobody actually spends four walls on a straight line, but every real cage is a cheaper version of that same decision.

Real cages use the edge of the board instead. The edge is free — it is a side you did not have to pay for. A pawn that has drifted into the a-file or the i-file already has one flank sealed by the board itself, which is why cages happen out there and almost never in the centre. Corners are better still: two free sides.

Pricing a cage: measure the door, not the walls

The useful number is not how many walls the cage contains. It is where the door sits relative to your line of travel — and, crucially, in which direction. A door displaced sideways and a door displaced backwards are billed at different rates: sideways costs one, backwards costs two, for the reason built into the distance model in Tempo and the race.

Reading a pocket is therefore two counts rather than one. Measure the door's lateral offset and its backward offset separately, then price each at its own rate and add them. A pocket whose only opening is one column to your left is a nuisance; the same pocket with its opening five ranks back can cost ten moves or more — in the region of what a whole game's worth of ordinary wall play buys, spent against you by one structure (wall economy prices the ordinary wall it is being measured against). The practical corollary is which part of the pocket to inspect first, and the tells below name exactly which one.

Why the payoff arrives all at once

Cages are the one wall structure whose payoff is not linear. Most walls pay once, on placement, at a rate wall economy works out exactly. A cage pays nothing on placement, several times in a row, and then pays everything.

The reason is worth understanding, because it is the mechanism the whole page rests on. A wall lengthens a path only when it cuts the last cheap way round. While a pocket still has two exits, a wall across one of them lengthens nothing — it diverts. The shortest route re-forms through the other exit at the same cost, and the number you are trying to move does not move at all. So the early walls of a cage are fence posts: measured one at a time they are worth zero, and they are placed not to block but to be anchors. A wall floating in open space, with both ends free, is worth almost nothing to anybody. A wall with one end against the board edge and the other against a standing wall can be worth many squares. What the first two walls of a cage are manufacturing is not blockage but anchor points for the third.

That gives a cage a return curve shaped like flat, flat, flat, cliff. It also makes a cage a speculative investment in the strict sense: you pay in advance, in walls and in turns, on a return that only exists if you are still allowed to place the final piece. An aborted cage is therefore not a partial success — it is close to a total loss. Walls that are worth a dozen squares in combination are worth a small fraction of that individually, and unlike a single mistimed wall they cannot be re-priced later: the walls are spent, and the grooves they occupy are gone with them.

The defender has the better end of the deal

Here is the arithmetic that decides most attempted cages, and it favours the person inside. Building a k-wall cage costs the builder k turns. Between those turns, the defender gets k−1 moves. Escaping usually takes one.

The flat part of the return curve is what makes that lopsided. During the fence-post phase the builder is spending real turns for a measurable gain of zero, which means the defender can be entirely passive and still come out ahead — every step they take forward is banked, and every wall the builder places is not. So a cage only works if there is no single step at any intermediate stage that defuses it: if every position along the build is already committed. That is a demanding condition, and it is why cages succeed mostly against players who are not looking. Against a player who is, the builder spends three walls and three tempi to achieve nothing, while the defender spends one tempo to step sideways and pockets the other two as forward progress.

The defender has a second resource that is easy to forget: their own walls. You do not have to dodge a cage; you can deny it. A wall placed in the groove the builder needs cannot be built through — walls may touch at a corner but never cross or overlap — and sometimes your own wall in the right slot makes the intended closing wall illegal outright, because with your wall down, theirs would leave you no path at all. One defensive wall placed in the right groove can invalidate three of theirs.

What will not save you is your pawn. Bodies are not walls: standing in an oncoming opponent's way hands them a jump rather than stopping them. See the rules for how the jump and its diagonal fallback resolve.

The tells

Cages announce themselves, if you know the signals.

A wall that does nothing. In ordinary play a wall that adds zero to your path is a wasted wall, and you can shrug it off. Near your pawn, it is the single most reliable early warning there is, because a fence post (the glossary has the term) is exactly what a wall worth zero looks like from the inside.

A wall behind you. Nobody spends a wall on the side of your pawn you are already leaving. It cannot slow your advance. It can only lengthen the trip back — which is to say, it is only worth placing if your opponent is planning to make you take that trip.

The next square, imagined gone. Take the square directly in front of you and ask what your distance becomes if a wall appears across it. On open ground the answer is one extra move: you go round a shoulder and resume, and wall or advance works out why a lone wall can rarely do better than that. When the answer is four or more, you are already standing in a pocket and the wall that proves it has simply not been played yet. Do not wait for it — the defining property of a cage is that the moment it becomes visible is the moment it is closed.

The two-turn question. Ask what your opponent could do to your path with two walls in a row rather than one. Single-wall thinking sees a four-square hit and calls it survivable. It is the second wall that turns a pocket into a detour, and you only get one move in between.

A measured example

The engine work on this site keeps a small regression fixture of cage positions, extracted from two recorded human-versus-bot games that the human won from the P1 seat (src/lib/quoridor/trap/real-games.ts:91-114). One position in it — labelled NEMESIS#13 — shows how fast the number moves. The bot was five steps from finishing. The best single wall available to the human added four squares to that five. A second wall on top of it brought the total to twelve — a pawn five moves from victory now seventeen moves from victory. The bot, on move in that position, stepped further into the pocket and lost. Those figures are not an illustration: they are the fixture's own, recomputed from the position and pinned by a test, so if the extraction ever drifts the test fails (src/lib/quoridor/trap/trap-suite.ts:74-83, asserted at trap-suite.test.ts:31-35).

That +12 is a greedy figure — best wall, then best wall again — and it is documented as a lower bound rather than an exact one, since a pair of walls chosen together can beat a pair chosen one at a time. Positions enter that fixture at a greedy two-wall total of eight or more (SUITE_THRESHOLD_2WALL, src/lib/quoridor/trap/trap-suite.ts:19,48-49), which is a reasonable threshold to carry into your own games: if two walls could add eight, you are already in a pocket, whatever the position looks like.

It is worth saying why a strong search walks into this at all. The standard bots here run a Monte Carlo tree search with no static evaluator: it plays the position out to a finish, over and over, and a move's value is simply how often those playouts ended in a win — a 1/0 terminal outcome propagated back up the tree, with nothing scoring the position itself (src/lib/quoridor/engine/mcts/uct-search.ts:27-31,145-165). (The one exception on the roster is the experimental neural bot, which does carry a learned evaluator — and is the weakest bot on the list: at equal wall-clock it won 0 of 12 games against every ladder tier including Beginner, tournament-results/2026-07-12-nn-ladder-placement/README.md.) Nothing anywhere in a rollout says "this looks like a pocket". Worse, walls appear inside a playout only on a minority branch of its policy — the rollout takes a pawn step roughly seven times in ten and only otherwise looks at a wall (engine/mcts/rollout.ts:119,149-151) — so a pocket is something the search discovers statistically or not at all: enough playouts have to wander into the trap for the win rate to sag. Difficulty on this site is a count of playouts and nothing else — 2,500, 7,500, 20,000 and 60,000 rollouts a move across the top four tiers (V3_TIER_SIMS, engine/mcts/engine-v3.ts:106-111) — which means the lower tiers are not playing a shallower kind of Quoridor. They are running too few samples to notice a structure that only shows up in a minority of them.

Getting out, and when not to bother

Step out early. The cost of leaving a pocket one move too soon is one tempo. The cost of leaving one move too late is the whole detour. Those are not close, so you do not need to be confident that a cage is coming to justify the step — a real suspicion is enough.

But dodging is not the only answer, and sometimes it is the wrong one. If the cage will cost your opponent three walls and three turns, those are three turns you get to spend walking. Count the race honestly (see tempo and the race) with the detour included: if you still arrive first, walk through the cage and let them build it. A completed cage that does not change who wins is the most expensive mistake in the game.

When building one is right

Cages are for when you are losing, and specifically for when you are losing by more than one wall can repair. That distinction is the whole justification. It is ordinary advice that falling behind is when a wall stops being optional (how to play covers that); the deeper case is what to do when the gap is larger than the instrument. Three or four squares down, the problem is not that a wall is warranted — it is that no single wall produces a swing of that size. A structure is the only thing on the board with enough variance to close a gap that big, and the price of that variance is precisely the flat return curve above: it can also produce nothing.

Look for a target that has committed: a pawn on an outer file, deep, with a shortest path that runs through ground you can pinch. Then place your walls in an order where each one already threatens something on its own, so an opponent who ignores you loses immediately and an opponent who reacts still loses ground — a fence post that doubles as a threat is the only kind you can afford, because it is the only kind that still pays if the cage never closes.

And keep a stop rule. If a wall you have just placed did not move the number and does not visibly threaten to on the next one, stop building. The walls already spent are gone either way; the only live question is whether to send more after them. Half a cage is the shape this whole plan fails into, and it fails quietly, one reasonable-looking wall at a time.

If the cage does land, what follows is usually a long, wall-poor march, which is a different skill — endgames covers it.

Last updated 2026-08-06