Wagon Works ★★★![[New!]](../images/new.gif)
Here you see a small shunting yard with two wagons (blue and green) and a locomotive (red).
The wagons are 5 meters long and the locomotive is 10 meters long. The dead-end section between the buffer and the switch in the bottom left is 5 meters long (the locomotive cannot switch tracks at the switch in the bottom left). The dead-end section between the buffer and the switch in the bottom right is 15 meters long. The locomotive can drive both forward and backward and can push or pull the wagons.

The question: How should the locomotive shunt the wagons so that the wagons have swapped places (the green one on the left and the blue one on the right) and the locomotive is back in its starting position (in the middle at the bottom)?

A hint : Solve the problem interactively!
- Click on a flag (
) to move the locomotive to the desired position (flags are only displayed at positions where the locomotive can drive directly).
- Is there a wagon at that position? Then it will be automatically coupled.
- At the ends of the shunting yard, the locomotive will continue until it can go no further.
- When moving to an intermediate position, the locomotive will attempt to place a detachable wagon at the specified position. If that is not possible (for example, because there are no wagons coupled to the locomotive), the locomotive will stop itself at that position.
- Click on the
symbol to uncouple a wagon.

The answer: Click here!