Tracks (Simon Tatham's Puzzles)
Saved games stay in this browser only.
About the puzzle
Tracks is a railway-building puzzle. The two ends of a line, A and B, sit on the edge of the grid, and a few squares already have rails in them. Numbers along the top and the right say how many squares of each column and row the track passes through. Your job is to lay the one route from A to B that fits every number, using only straight pieces and quarter-turn curves.
James Harvey wrote it for Simon Tatham's collection; the same idea appears in puzzle books as Train Tracks.
Rules
- Build a single track from A to B. Each square it passes through holds either a straight piece or a 90-degree curve.
- The track never crosses itself and has no branches or loops.
- The clue for each row and column is the number of squares in it that the track passes through.
- The pieces already on the board are part of the route.
Controls
| Input | Action |
|---|---|
| Left click on the edge between two squares | lay a piece of track across that edge, or remove it |
| Right click on an edge | cross it out: the track does not pass here |
| Left click inside a square | mark that the square has track, before you know which way it runs |
| Right click inside a square | mark that the square has no track |
| Left- or right-drag across squares | mark a straight line of squares as track / no track |
| N / U / R | new game / undo / redo |
How to solve it
Zeros and full lines. A row or column with a clue of 0 is empty: cross it all out. A line whose clue equals the squares still available uses all of them.
Extend the given pieces. Every given piece and both ends point somewhere. A rail that leads to the edge of the grid, into a crossed-out square or into a dead end cannot go that way, which often leaves one direction.
Squares with track need two exits. A square you know has track must connect to exactly two neighbours. If two of its four sides are blocked, the other two are its exits.
Don't close a loop. A short piece of track that would join up with itself is not allowed, so the side that would close the circle is out. Every loose end must eventually lead back to A or B.
Parity. Imagine a line between two columns (or two rows). If A and B are on different sides of it, the track crosses it an odd number of times; if they are on the same side, an even number. When only one edge across that line is still open, this tells you whether the track uses it.
Sizes and difficulty
The Type menu has 8x8, 10x8, 10x10, 15x10 and 15x15 grids at Easy and Tricky, and 10x10 and 15x15 also at Hard. Tricky and Hard expect you to rule out moves because they would lead to an impossible crossing later. Custom sets the size and the difficulty, and can allow two neighbouring rows or columns to both have a clue of 1, which the generator normally avoids to keep the track twisty.
Playing here
Click Play to open the puzzle. The menu above the board has New game, Restart, Undo, Redo and Solve (which you can undo to keep going on your own), the Type menu with the sizes, and the Game menu, where you can type in a game ID or a random seed, download the current game as a file, load a saved file and change the preferences. Your game in progress is kept in this browser and comes back with its whole undo history the next time you open the page.
On a touch screen, tap the edge between two squares to lay track, or tap inside a square to mark it; turn on the Mark button above the board to cross out edges and squares instead.
Credits and licence
Tracks was written by James Harvey for Simon Tatham's Portable Puzzle Collection, which Simon Tatham maintains with code contributed by several other authors and distributes with its source code under the MIT licence. This page runs a WebAssembly build made by FredyGames from the author's official source snapshot, with no changes to the puzzle; the source and the build script are hosted with the game, and the licence text is linked from this page.