Breaking loops so every clerk finds their docket
What the loop trail is, why swapping inside a loop splits it, how the swap budget is calculated, and the thinking method that turns a hard-looking puzzle into simple arithmetic.

The problem behind the puzzle
A row of drawers contains numbered dockets, one per drawer, all in the wrong order. A clerk who needs docket seven opens drawer seven, reads the number inside, opens that drawer next, and follows the chain. Because every number appears exactly once, that chain always comes back to where it started. The chain forms a loop.
The loop might be short. A clerk opens three drawers and finds their docket. Or it might be long. A clerk opens twelve drawers before the trail comes back around. The trouble is that each clerk may only open a limited number of drawers. If their loop is longer than that limit, they never find their docket.
Your job is to swap dockets between drawers until no loop is longer than the limit. You have a fixed number of swaps to do it.
Reading the board
Each drawer is shown as a numbered box with a coloured slip inside it. The slip shows which docket is in that drawer. Drawers on the same loop share a colour, so you can see the loops at a glance.
Below the drawers is a list of loops with their lengths. Any loop longer than the limit is marked in red and labelled too long. Short loops that already fit within the limit have no marker.
The stats bar shows three numbers. Longest loop tells you the current longest and what the limit is. Swaps left tells you how many more swaps you can make. Fewest swaps tells you the smallest number of swaps that could solve this arrangement, which is the par for the puzzle.
Controls and board sizes
Tap or click a drawer to select it. It highlights. Tap a second drawer to swap their contents. If you tap the same drawer again, the selection clears and nothing happens.
A dropdown labelled Office offers three sizes. Small has nine drawers and a limit of three. Medium has twelve drawers with a limit of three. Large has fifteen drawers and a limit of four. The New game button generates a fresh arrangement.
The swap budget is the par plus a small amount of slack. On small and medium boards you get one extra swap beyond par. On large boards you get two. If you run out of swaps before every loop is short enough, the game ends.
Same loop splits, different loops join
This is the single most important rule. When you swap the contents of two drawers that are on the same loop, the loop splits into two shorter loops. When you swap the contents of two drawers on different loops, the two loops merge into one longer loop.
Splitting is what you want. Merging is the opposite. Before every swap, check the colours. If both drawers share the same colour, you are about to split. If they have different colours, you are about to merge, and the result will be worse than where you started.
A merge is not always fatal. Sometimes merging two short loops and then splitting the result in a better place costs fewer total swaps. But that is an advanced move. For most puzzles, the rule is simple: never swap across colours.
Where to cut a long loop
A loop of length nine with a limit of three needs two swaps. Each swap splits the loop into two pieces. But the pieces must all be three or shorter, so the cuts have to be spaced evenly.
Think of the loop as a circle of drawers. If you cut it near the top and near the bottom, you get three roughly equal pieces. If you cut it twice next to each other, you get one tiny piece and one piece that is still too long. Spacing matters.
The formula for the minimum number of swaps on a single loop is its length divided by the limit, rounded up, minus one. A loop of twelve with a limit of four needs two swaps. A loop of five with a limit of three needs one. Add those numbers across all long loops and you get the par.
A worked example on a medium board
Twelve drawers, limit of three. The board shows one red loop of length seven, one blue loop of length three, and one green loop of length two. The blue and green loops are already safe. Only the red loop needs work.
Seven divided by three, rounded up, is three. Minus one gives two swaps needed. You need to cut the red loop into three pieces, each of length three or less. The possible splits are 3-4 into 3 and 4, then 4 into 2 and 2. Or 3-2-2. Either way, two swaps and every piece fits.
Pick two drawers on the red loop that are three steps apart in the chain. Swap them. The loop splits into a piece of three and a piece of four. Now pick two drawers on the remaining four-long piece that are two steps apart. Swap. Three pieces, all within the limit, and the board turns green.
Short loops need nothing
Any loop at or under the limit is already safe. Leave it alone. A common mistake is to touch a short loop by accident, merging it with another one and creating a problem that did not exist before.
Before you start swapping, count the long loops and figure out how many swaps each one needs. If the total matches the par, you know exactly how many moves you have to work with. Every swap should be aimed at a specific long loop.
The mathematics that makes it surprising
The puzzle is built on a famous result in probability. Give a hundred clerks a hundred drawers and let each one open fifty. If they open drawers at random, the chance that all hundred succeed is vanishingly small. But if every clerk follows the trail from their own number, the chance jumps to about thirty-one per cent.
The reason is that the trail strategy ties everyone's fate to the loops. All clerks on the same loop succeed or fail together, and the whole group survives exactly when no loop is longer than half the drawers. The chance of a random shuffle having no loop longer than half is one minus the natural logarithm of two, roughly 0.307.
The puzzle version tightens the limit to a third of the drawers instead of half. With half, a single swap always fixes everything, and there is nothing to work out. A tighter limit makes the cut placement matter.
Difficulty levels and what changes
The three sizes are not just bigger grids. They play differently because the ratio of loop length to limit changes.
On a small board with nine drawers and a limit of three, the longest possible loop is nine, which needs two swaps. The puzzles are designed so that par is between two and four. You can usually see the whole arrangement at once and plan all your cuts before tapping anything.
Medium boards have twelve drawers and the same limit of three. Loops can reach twelve, needing three swaps. The extra drawers make it harder to see which drawers belong to which loop without checking the colours carefully.
Large boards jump to fifteen drawers and a limit of four. The wider limit means each loop can be longer before it needs a cut, but the sheer number of drawers makes the board harder to scan. Read the loop list below the drawers rather than tracing paths visually.
Common mistakes to watch for
- Swapping across two different loops. Check the colours first. Different colours mean a merge, not a split.
- Cutting a loop in the wrong place. Two cuts bunched together leave one piece still too long. Space them evenly around the loop.
- Spending swaps on short loops. Anything at or below the limit needs no work. Focus only on the red ones.
- Not counting before you cut. Figure out how many swaps each long loop needs and add them up. If the sum exceeds your budget, you need to find a more efficient path.
- Forgetting that merging and re-splitting is sometimes cheaper. Two short loops can be merged and re-split into different sizes if that helps break a longer loop with fewer total moves. It is rare, but worth knowing.
No data leaves your browser
The shuffle, the loop detection, and the swap counting all happen on your own device. No arrangement is sent anywhere. There is no account and no saved history. Close the tab and the puzzle is gone.
