One station, several views, several displays
A railway station has the dashboard’s problem: which trains to show and how to show them change for different reasons. Views (the next trains, then each platform) decide which trains appear; displays (an LED board, the announcer, then a phone alert) decide how a train is shown. Each level starts from the previous level’s finished code, so you can begin at any of them.
Platform changes are the announcement riders most need to hear. A teammate’s pull request adds them: a train now carries the platform it moved from, and the display contract gains it as a fourth argument. Reviewing it, QA reports that the announcer never mentions a change, and that riders on the phone see names cut off mid-word.
A rider waiting by ear on platform 2 never hears that the ferry train moved to platform 4. Every display but the board shows a name the board needed shortened, and the next display added will inherit both problems.
Reproduce Show the next trains on the announcer with the Harbour Ferry Terminal train leaving platform 4 in 3 minutes, moved from platform 2. It should say “The Harbour Ferry Terminal train leaves platform 4, not platform 2, in 3 minutes”. Today it says “The Harbour Ferr train leaves platform 4 in 3 minutes”.
Acceptance criteria Every display shows a moved train’s old platform, each its own way: the board “… P4 3 MIN WAS P2”, the announcer “… leaves platform 4, not platform 2, in 3 minutes”, the phone “Harbour Ferry Terminal (P4, was P2) 3 min”. A train that has not moved shows as before. Only the LED board shortens names: it shows a destination’s first 12 characters (“HARBOUR FERR P4 DUE WAS P2”). Every other display, and any display added later, receives the whole name. Both views still decide which trains appear, as before, for every display. Keep the pull request’s widened contract: departure(destination, platform, minutes, was). Notes Cases print what a view or a display returns, on one line. The checker shows both views on a display of its own, which writes a moved train as destination@platform+minutes<was, and calls each display’s operations directly. Keep every class, method and field name and the train helper. Destinations are plain ASCII, so a character is a byte in every language.