Skip to content

Train Tracks Solver

Enter a Train Tracks puzzle from a newspaper, magazine or book and get the solution in seconds, with a check that the answer is unique. Works on puzzles from 5×5 to 12×12, with A and B on any edge.

A (entrance)
B (exit)

Tap a square to cycle through the six pieces for any track already printed in your puzzle. Type the numbers in the boxes on the right and along the bottom.

Rows add up to 0, columns to 0.

How to use the solver

  1. Choose the grid size, then set where the track enters (A) and leaves (B). Most puzzles start on the left edge and finish on the bottom edge.
  2. Type the number beside each row into the boxes on the right, and the number under each column into the boxes along the bottom.
  3. Tap a square to cycle through the six track pieces if your puzzle shows a piece there. Leave squares blank when nothing is printed.
  4. Press Solve. The finished track appears below, with a note saying whether it is the only solution.

If you would rather work it out yourself, the Train Tracks strategy guide explains the techniques step by step, and our own puzzles have a Hint button that reveals one square at a time.

How it works

The solver walks the track outward from A one square at a time, trying straight, left and right at each step. Before every step it checks what is still possible: a row or column cannot go over its number, the track can never pass through B before the end, every printed piece must be reached, and parts of the grid that the track could enter but never leave are cut away. That pruning lets it search every possible route, not just one, so when it says a solution is unique, it has ruled out every alternative.

It is the same engine that checks every puzzle published on this site before it goes live.

Solver questions

What do I need to enter?

The grid size, the number beside every row and under every column, where A and B are, and any pieces of track already printed in the puzzle.

Why does it say there is more than one solution?

Published puzzles are designed to have one answer, so this usually means a printed piece or a number was missed or mistyped. Compare your entry with the puzzle and try again.

Does the solver guess?

No. It searches every possible track from A that fits the numbers and pieces, and reports how many complete routes exist (it stops counting at two).

Is my puzzle stored anywhere?

No. The solver runs entirely in your browser; nothing you type is sent to a server.