Building a machine that sorts without seeing the load
What a comparator station does, why fixing one sample can ruin another, how the zero-one principle makes checking possible, and the bubble-sort pattern that solves most boards on the first try.

The puzzle in plain terms
Parcels drop down a set of chutes, one parcel per chute. Along the way they pass through stations. Each station joins two chutes with a comparator: it looks at the two parcels on those chutes and swaps them if they are in the wrong order, so the smaller one always ends up on the upper chute. The stations act in sequence, first to last, and each one does the same comparison every time regardless of what the parcels are.
Your job is to set the chute pair for each station so that the machine sorts every possible load, not just the sample you can see on screen. Tap a station to cycle which two chutes it joins. When the score reads all loads sorted, you win.
Controls and what the board shows
The top of the board shows a sample load: the parcels in their starting order on the left and the result after passing through the machine on the right. Below that sit the stations, numbered from first to last. Each station shows which two chutes it currently joins, written as a pair of numbers.
Tap any station to cycle its pair to the next combination. The sample result updates instantly. The Try another load button shuffles a new set of parcels through the same machine, so you can check whether a change that helped one arrangement breaks another. The stats row shows how many loads the machine currently sorts out of the total, and how many changes you have made.
The three machine sizes
The Machine dropdown offers Small, Medium, and Large. A Small machine has three chutes and three stations. With three chutes there are only six possible orders, so three stations is enough to sort them all. Medium has four chutes and five stations. Large has five chutes and nine stations.
As the number of chutes grows, the number of possible load orders grows as a factorial: six for three chutes, twenty-four for four, one hundred and twenty for five. The station counts given are exactly the minimum needed for a correct sorting network at each size, so no stations are wasted and none are spare.
Each station can be set to any pair of chutes. On a Small machine with three chutes, there are three possible pairs per station: one and two, one and three, or two and three. On a Medium machine with four chutes, each station has six possible pairs. On Large, ten possible pairs per station. The game starts each station on a random pair, and the starting arrangement is guaranteed not to already be a correct network.
Why fixing one load can ruin another
A comparator has no memory. It cannot behave one way for one load and another way for a different load. Every time it sees two values, it puts the smaller one on top and the larger one on the bottom. That is all it does.
This means a station that fixes the sample you are looking at may undo the sorting done by an earlier station on some other arrangement of parcels. You might tap a station, watch the sample come out perfectly sorted, try another load, and find it worse than before. That is the core of the puzzle: the machine has to work for all loads at once, not one at a time.
How the game checks every load
Checking every load by brute force sounds expensive. Four chutes have twenty-four possible orderings, and five have one hundred and twenty. But a mathematical result called the zero-one principle makes it much cheaper. It says that a comparator network sorts every possible input exactly when it sorts every sequence made only of zeros and ones.
For four chutes, that means checking just sixteen binary sequences instead of twenty-four permutations, and the savings grow fast as chutes increase. The game uses exactly this test. The Loads sorted counter in the stats row is the number of binary sequences the machine handles correctly out of the total.
The reason the shortcut works is that a comparator never invents new values. It only swaps or leaves alone. If any real input comes out wrong, you can turn it into a binary sequence that also comes out wrong by writing zero for everything below a certain threshold and one for everything above. So testing all binary inputs is enough to catch every possible failure.
Strategy: think in bubble passes
The simplest machine that sorts is a bubble sort. Compare the first and second chutes, then the second and third, then the third and fourth, and so on. That single sweep drags the largest parcel to the bottom of the chutes. Repeat the pass and the second largest ends up in its proper place. Keep repeating until every parcel is home.
On a Small machine with three chutes and three stations, the bubble pattern is: join chutes one and two, then two and three, then one and two again. That works for every load. On larger machines the same idea applies: fill the stations with repeated neighbouring-pair passes. It is not always the only solution, but it is almost always a correct one and a reliable starting point when you are stuck.
Strategy: work from the outside in
Once the first pass pushes the largest parcel to the bottom, you know that chute is settled. The next pass only needs to handle the remaining chutes above it. This means later stations can focus on pairs closer to the top.
On a Medium machine with four chutes and five stations, a working arrangement is: join one and two, then three and four, then one and three, then two and four, then two and three. Notice how the first two stations handle the outer pairs in parallel (even though they act sequentially, their effects do not interfere), and the last three sort the middle. Thinking about which positions are already settled helps you avoid wasting stations.
Common mistakes and dead ends
- Judging by one sample. A machine that sorts three loads in a row can still fail on the fourth. Press Try another load often, and trust the score counter over your eyes.
- Changing the last station to fix a problem. Whatever reaches the last station is already nearly sorted or is not. Problems have to be solved earlier in the machine, not patched at the end.
- Joining distant chutes first. Comparing chutes one and five before comparing neighbours is rarely useful. Neighbouring pairs do the heavy lifting in most correct networks.
- Duplicating a station. Two stations joining the same pair means the second one does nothing every time, because the first already put those two chutes in order. It wastes a valuable station.
- Giving up after five changes. The machines are small and there are only a handful of pair choices per station. Cycling through them methodically, one station at a time from the first to the last, is faster than guessing at random.
- Ignoring the score counter. It tells you exactly how many loads still fail. Watch how the count moves each time you tap a station: if it drops, undo the change and try a different pair.
Scoring and what a good result looks like
The game counts changes, and fewer is better. Your best result on each machine size is saved. A perfect score on a Small machine might be three or four changes if you spot the pattern quickly. On a Large machine, getting it right in under fifteen changes is a solid result.
There is usually more than one correct arrangement of stations. Any machine that sorts every load wins. The game does not require a specific solution, just a working one. Experimenting with unusual pair choices can sometimes lead to a correct network that looks nothing like the bubble-sort pattern, which is part of the fun.
No data leaves your device
The stations, the loads, and the zero-one test all run inside your browser. No data is sent to a server. Your best score is stored in this browser's local storage on this device only. There is no account and no leaderboard. Close the tab and the machine is gone.
