One dead end, one stack, and the orders that cannot be shunted
Siding is a railway shunting puzzle that teaches a deep piece of computer science while pretending to be about trains. Wagons arrive in one order and must leave in another, and all you have is a single dead-end siding. Because the siding is a dead end, the last wagon you push in is the first that can come out. That constraint is exactly what makes some orders possible and others genuinely impossible, and understanding why is the real lesson hiding inside the game.

How the puzzle works
A line of wagons arrives at one end of the yard, each marked with a letter. A second line at the top of the screen shows the order they must leave in. Between the two sits a single siding, a dead-end track that can hold a limited number of wagons. Your job is to shunt every wagon from the arriving road to the departure road in the order asked for, using the siding as a buffer when the next wagon you need has not arrived yet.
Each turn you make exactly one of three moves. You can push the next arriving wagon into the siding. You can send the next arriving wagon straight through to the departure road. Or you can pull the top wagon out of the siding onto the departure road. There is no fourth option and no way to rearrange wagons once they are on the departure road or deep inside the siding stack. The constraint is total: wagons travel from the arriving road to the siding, from the arriving road to the departure road, or from the top of the siding to the departure road. No other direction is ever allowed.
Controls and interface
Three buttons drive the puzzle. Push into siding takes the front wagon from the arriving road and places it on top of the siding stack. Straight through sends the front arriving wagon directly to the end of the departure road. Pull from siding takes the top wagon off the siding and adds it to the departure road. Each button greys out when its action is not available, so you always know what you can do.
The top row shows ghosted wagons in the wanted order. As each wagon reaches the departure road in the correct position, its ghost fills in. A wagon landing in the wrong position ends the round immediately, because the departure road cannot be reshuffled. The siding row shows its current fill and its maximum capacity.
Scoring and the par system
Your score is the number of moves it takes to assemble the correct departure order. The game searches every legal sequence of pushes, pulls and straight-throughs to find the true minimum, which it displays as the par. Every wagon costs at least one move, and any wagon that visits the siding costs two, so the par is always at least as large as the number of wagons. Matching the par means you found the absolute shortest solution, because the search is exhaustive.
You are given a budget of moves equal to the par plus a small cushion. Run out of moves before the train is assembled and the round ends. A wrong wagon on the departure road also ends the round instantly, since the departure road cannot be reshuffled. Your best score is tracked across sessions, stored in your browser on this device and never sent anywhere. Lower scores are better, and the game tells you how your finish compared with the minimum.
Difficulty levels
The Train selector offers three sizes. Small gives you four wagons and a siding that holds three. Medium raises the count to five wagons with the same siding capacity. Large uses six wagons and increases the siding to four slots. The larger trains are harder not because the siding fills faster, but because there are more wagons competing for limited buffer space and the look-ahead becomes longer.
At every level the game guarantees that the order it asks for can actually be shunted. It does this by running a random shunt on a real train and writing down whatever comes out. That output is always reachable by definition, which avoids handing you an impossible task.
Strategy: reading the wanted order before you move
The most important habit is to scan the entire wanted order before touching anything. Look for wagons that are already in the right position in the arriving line. A wagon that needs to leave in the same position it arrives in should go straight through, because routing it through the siding wastes two moves instead of one.
Next, look for runs of wagons that need to leave in reverse order. The siding reverses whatever you push into it, so three consecutive wagons that must depart in backward order can be pushed in together and pulled out in the correct sequence. Spotting those runs is the key to matching or beating the par.
Strategy: managing siding capacity
The siding has a hard limit, and filling it with wagons you cannot yet release is the most common way to lose. Before pushing a wagon in, ask yourself whether you will be able to pull it out before the siding overflows. If the wagon on top of the siding is not needed until much later, every wagon pushed on top of it must also not be needed until after that one leaves.
A useful rule of thumb is to avoid pushing a wagon into the siding unless the wagon currently on top will be needed before or at the same time. Stacking two wagons that are both needed late creates a bottleneck that only gets worse as arrivals continue.
Common mistakes and how to avoid them
The fastest way to fail is sending a wagon straight through when it is not the next one wanted. Once a wagon is on the departure road it cannot be moved, so a single misplaced wagon ends the round. Always check the wanted row before pressing straight through.
Another frequent error is pushing too eagerly. Every push uses a move and commits you to pulling that wagon out later, which is a second move. If the wagon you need next is arriving, there is no reason to route it through the siding at all. Sending it straight through saves a move every time.
Forgetting that the siding reverses order is a subtler trap. Two wagons pushed in as A then B come out as B then A. If you need them in the original order, pushing both into the siding actually makes the problem worse.
Why some orders are impossible with one siding
A dead-end siding is exactly what computer scientists call a stack: last in, first out. Not every order can be produced with a single stack, and the impossible ones all fail for the same structural reason. If three wagons arrive as A, B, C and you need C first, then A, then B, the siding cannot help. Getting C out first means A and B must both be in the siding with A underneath. They can only come out B then A, never A then B.
With four wagons, exactly fourteen of the twenty-four possible orders can be shunted. That count is the fourth Catalan number, and the sequence continues as the train grows. With five wagons the count rises to forty-two out of a hundred and twenty, and with six it is a hundred and thirty-two out of seven hundred and twenty. The game never offers an impossible order, but knowing why they exist turns each puzzle from guesswork into deduction. You start looking for the three-wagon pattern that would trap you, and that look-ahead is exactly what good play requires.
Privacy and how the game runs
The entire puzzle runs inside your browser tab. Nothing is uploaded, there is no account, and your best score stays on this device in local storage. Once the page has loaded it works offline, so you can solve shunting puzzles on a train or a plane without a connection.
The par is computed by a breadth-first search over every legal move sequence, so the answer is exact rather than estimated. The puzzle generator works the same way: it shunts a real train at random and records the output, then verifies the order by searching for the shortest solution. If the result would be trivial, such as the arriving order being the same as the wanted order, the generator tries again. The entire process takes a fraction of a second even on a phone.
