Sorting Yard
Sort trains with your program. Read a sensor to tell what kind of train is coming, then throw the points to send it the right way.
No hardware, no sign-up: press Play and every mission runs on 3D simulated devices.
Passenger and freight trains come out of a tunnel in a mixed-up order. Freight wagons are taller, so only they reach the cargo sensor mounted up high. Your program reads it and throws the points before the train gets there: passengers to town, freight into the yard. Throw the points while a train is on them and it comes off the rails!
What you'll learn
- If-then: read a sensor and pick the right way
- Timing: decide and throw the points before the train arrives
- Counting by kind: two counters, one for each kind of train
Levels
- Left or right?: freight goes right, passengers go left
- Passengers only: passenger trains stop 3 seconds at the platform, freight runs straight through, with the signal
- Count them apart: faster trains, and each kind counted on its own counter