Trainyard
A railroad switching puzzle: sort the freight, make par.
Trainyard is a turn-based puzzle game about working a railroad classification yard. A switch engine stands on a single lead at the foot of a ladder of tracks. Every car on the tracks is bound somewhere, every track has an assignment, and every pull or shove is one move. The aim is to sort the yard in as few moves as it can be sorted.
The game starts with a boxcar and a lead and ends, 5061 yards later, with humps, tonnage ratings, timetables, sealed blocks, helper engines and trains doubled across two tracks. Each yard’s par is proven by a solver, so three stars always means the shortest line there is. There is also a daily yard, the same puzzle for everyone, with a streak to keep.
How to play
- Pull
- Click a car on a track. That car and every car between it and the ladder couple to the engine and come out onto the lead.
- Shove
- Click a car on the lead to select it and every car behind it, then click a track to shove them in. Cars enter from the ladder end.
- Capacity
- The lead holds a fixed number of cars behind the engine and every track has a capacity. Some engines carry a tonnage rating too.
- Goals
- A single chip under a track means every car for that destination and nothing else. A row of chips is an outbound train that must stand in exactly that order.
- Par and stars
- Every yard has a par, and the pars are proven optimal by a solver. Three stars at par, two within two moves, one for finishing. Progress is saved in the browser.
- The line
- Stations open in order along a railroad map grouped into divisions and chapters. Finishing a division earns a new engine from the engine house.
- Challenges
- Every yard has two variants, such as a smaller engine or a different outbound order, which open once the yard is finished at par.
- Keys
- Z undo, R restart, M map, S sound, N and P next and previous yard, Esc cancels a selection. On the map, Enter plays the next unfinished yard, E opens the engine house and L the line book.
The line
The main line opens with 17 hand-made divisions, each of which introduces a rule of real yard work, then runs on through 250 generated chapters of twenty yards that pair those rules in new ways and climb slowly in difficulty.
- Flatland Division Small yards, straight answers
- River Division Outbounds, hazmat, short power
- Mountain Division Heavy trains, a hump, placards that may not roll
- Valley Division Tracks behind tracks
- Junction Division A yard open at both ends
- Night Division Kicks, placards, unread waybills
- Summit Division Cabooses ride last, never over the hump
- Mainline Division Trains on a timetable
- Coast Division Auto racks, two lengths long
- Terminal Division A wye to turn cars
- Shop Division Bad-order cars stop at the RIP track
- Industry Division Outbounds with open slots
- Block Division Sealed blocks that move as one
- Dispatch Division Yard orders that fire on the clock
- Helper Division A second engine on the far lead
- Doubling Division One train across two tracks
- Repair Division Bad-order cars take their time
Then the chapters: Chapter 1: Sorting, Chapter 2: Outbounds, Chapter 3: The hump, Chapter 4: Stub tracks, Chapter 5: Placards, Chapter 6: The running track, and on to Chapter 250: Kicks and outbounds. See every chapter.
The daily yard
Every day there is one more yard, generated from the date so that everyone gets the same one. It sits on the spur at the bottom left of the map, or at https://trainyard.fun/daily/. Finish it on consecutive days to build a streak.
About the game
Switching, or shunting, is the work of sorting freight cars into trains. A classification yard does it with a ladder of tracks, a lead, and sometimes a hump: a rise the cars roll down one at a time into their tracks. Trainyard keeps the real constraints, from track capacity and tonnage to hazmat placards and timetables, and turns each one into a puzzle rule. It runs in any modern browser, on desktop or phone, with nothing to install.