GridPaw cat puzzle icon GridPaw

Train Tracks Solver: a 12×12 puzzle, one deduction at a time

This page does not just print an answer. It solves a 12×12 Train Tracks board the way a person would — 264 deductions, each one forced by a rule you can check — and you can walk through them. Every step below says which rule fired, so when you get stuck on your own puzzle you can find the same rule and apply it yourself.

Step 0 of 264
12433333333312122222222231212 A B

Press Play, or step through with the arrows. The board fills in exactly as the solver decided it.

How each step is forced

Four kinds of reasoning, strongest and simplest first. A board that needs only the first kind is gentle; one that needs the last is where people usually get stuck.

  1. Row and column counts. The number beside a row or column is how many squares in it hold rail. Once a row has that many, every other square in it is empty; when the remaining squares are exactly the count, they all hold rail.
  2. Cell degree. A square with rail holds exactly two joints — a straight or a corner. A square with one joint and only one open side must take it, and cannot exist at all with only one open side. A and B are the exceptions: one joint each, the line leaving the board through them.
  3. Connectivity. The rail is one unbroken line from A to B. A piece that can no longer reach anything is a contradiction; once A and B are joined, every square outside that line is empty.
  4. Contradiction. Some positions only fall to case analysis: assume rail, watch the rules break, so it must be empty. This is the step that separates a 12×12 board from a 7×7 one, and it is why a solver has to be honest about what it guessed.

Is your own puzzle solvable this way?

One thing worth knowing before you trust any solver: a Train Tracks board can have more than one answer. Two boards can carry identical row and column counts and still differ. If a solver only checks that the counts add up, it will happily "solve" a board that has several solutions. The board on this page is checked both ways before it ships — exactly one solution, and finishable without guessing — so the steps you see here really do force the answer.

The full deduction

264 steps. Each row names the rule, the side it decides, and why. Sides are given as the n-th horizontal or vertical line, counting from 1.

#RuleActionWhy
1 cell degree rail h2/1 r1c1 still needs 2 rail joint(s) and has only 2 undecided side(s)
2 cell degree rail v1/2 r1c1 still needs 2 rail joint(s) and has only 2 undecided side(s)
3 cell degree rail h2/12 r1c12 still needs 2 rail joint(s) and has only 2 undecided side(s)
4 cell degree rail v1/12 r1c12 still needs 2 rail joint(s) and has only 2 undecided side(s)
5 cell degree rail h12/1 r12c1 still needs 2 rail joint(s) and has only 2 undecided side(s)
6 cell degree rail v12/2 r12c1 still needs 2 rail joint(s) and has only 2 undecided side(s)
7 cell degree rail h12/12 r12c12 still needs 2 rail joint(s) and has only 2 undecided side(s)
8 cell degree rail v12/12 r12c12 still needs 2 rail joint(s) and has only 2 undecided side(s)
9 column count empty h2/2 Column 2 needs 2 square(s) and already has 2
10 column count empty h3/2 Column 2 needs 2 square(s) and already has 2
11 column count empty v2/2 Column 2 needs 2 square(s) and already has 2
12 column count empty v2/3 Column 2 needs 2 square(s) and already has 2
13 column count empty h4/2 Column 2 needs 2 square(s) and already has 2
14 column count empty v3/2 Column 2 needs 2 square(s) and already has 2
15 column count empty v3/3 Column 2 needs 2 square(s) and already has 2
16 column count empty h5/2 Column 2 needs 2 square(s) and already has 2
17 column count empty v4/2 Column 2 needs 2 square(s) and already has 2
18 column count empty v4/3 Column 2 needs 2 square(s) and already has 2
19 column count empty h6/2 Column 2 needs 2 square(s) and already has 2
20 column count empty v5/2 Column 2 needs 2 square(s) and already has 2
21 column count empty v5/3 Column 2 needs 2 square(s) and already has 2
22 column count empty h7/2 Column 2 needs 2 square(s) and already has 2
23 column count empty v6/2 Column 2 needs 2 square(s) and already has 2
24 column count empty v6/3 Column 2 needs 2 square(s) and already has 2
25 column count empty h8/2 Column 2 needs 2 square(s) and already has 2
26 column count empty v7/2 Column 2 needs 2 square(s) and already has 2
27 column count empty v7/3 Column 2 needs 2 square(s) and already has 2
28 column count empty h9/2 Column 2 needs 2 square(s) and already has 2
29 column count empty v8/2 Column 2 needs 2 square(s) and already has 2
30 column count empty v8/3 Column 2 needs 2 square(s) and already has 2
31 column count empty h10/2 Column 2 needs 2 square(s) and already has 2
32 column count empty v9/2 Column 2 needs 2 square(s) and already has 2
33 column count empty v9/3 Column 2 needs 2 square(s) and already has 2
34 column count empty h11/2 Column 2 needs 2 square(s) and already has 2
35 column count empty v10/2 Column 2 needs 2 square(s) and already has 2
36 column count empty v10/3 Column 2 needs 2 square(s) and already has 2
37 column count empty h12/2 Column 2 needs 2 square(s) and already has 2
38 column count empty v11/2 Column 2 needs 2 square(s) and already has 2
39 column count empty v11/3 Column 2 needs 2 square(s) and already has 2
40 cell degree rail v1/3 r1c2 still needs 1 rail joint(s) and has only 1 undecided side(s)
41 cell degree empty h2/11 r1c11 already has 1 rail joint(s)
42 cell degree empty v1/11 r1c11 already has 1 rail joint(s)
43 cell degree rail h3/1 r2c1 still needs 1 rail joint(s) and has only 1 undecided side(s)
44 cell degree rail h4/1 r3c1 still needs 1 rail joint(s) and has only 1 undecided side(s)
45 cell degree rail h5/1 r4c1 still needs 1 rail joint(s) and has only 1 undecided side(s)
46 cell degree rail h6/1 r5c1 still needs 1 rail joint(s) and has only 1 undecided side(s)
47 cell degree rail h7/1 r6c1 still needs 1 rail joint(s) and has only 1 undecided side(s)
48 cell degree rail h8/1 r7c1 still needs 1 rail joint(s) and has only 1 undecided side(s)
49 cell degree rail h9/1 r8c1 still needs 1 rail joint(s) and has only 1 undecided side(s)
50 cell degree rail h10/1 r9c1 still needs 1 rail joint(s) and has only 1 undecided side(s)
51 cell degree rail h11/1 r10c1 still needs 1 rail joint(s) and has only 1 undecided side(s)
52 cell degree rail v12/3 r12c2 still needs 1 rail joint(s) and has only 1 undecided side(s)
53 column count empty h2/3 Column 3 needs 2 square(s) and already has 2
54 column count empty h3/3 Column 3 needs 2 square(s) and already has 2
55 column count empty v2/4 Column 3 needs 2 square(s) and already has 2
56 column count empty h4/3 Column 3 needs 2 square(s) and already has 2
57 column count empty v3/4 Column 3 needs 2 square(s) and already has 2
58 column count empty h5/3 Column 3 needs 2 square(s) and already has 2
59 column count empty v4/4 Column 3 needs 2 square(s) and already has 2
60 column count empty h6/3 Column 3 needs 2 square(s) and already has 2
61 column count empty v5/4 Column 3 needs 2 square(s) and already has 2
62 column count empty h7/3 Column 3 needs 2 square(s) and already has 2
63 column count empty v6/4 Column 3 needs 2 square(s) and already has 2
64 column count empty h8/3 Column 3 needs 2 square(s) and already has 2
65 column count empty v7/4 Column 3 needs 2 square(s) and already has 2
66 column count empty h9/3 Column 3 needs 2 square(s) and already has 2
67 column count empty v8/4 Column 3 needs 2 square(s) and already has 2
68 column count empty h10/3 Column 3 needs 2 square(s) and already has 2
69 column count empty v9/4 Column 3 needs 2 square(s) and already has 2
70 column count empty h11/3 Column 3 needs 2 square(s) and already has 2
71 column count empty v10/4 Column 3 needs 2 square(s) and already has 2
72 column count empty h12/3 Column 3 needs 2 square(s) and already has 2
73 column count empty v11/4 Column 3 needs 2 square(s) and already has 2
74 cell degree rail v1/4 r1c3 still needs 1 rail joint(s) and has only 1 undecided side(s)
75 cell degree rail h2/10 r1c10 still needs 2 rail joint(s) and has only 2 undecided side(s)
76 cell degree rail v1/10 r1c10 still needs 2 rail joint(s) and has only 2 undecided side(s)
77 cell degree rail v12/4 r12c3 still needs 1 rail joint(s) and has only 1 undecided side(s)
78 column count empty h2/4 Column 4 needs 2 square(s) and already has 2
79 column count empty h3/4 Column 4 needs 2 square(s) and already has 2
80 column count empty v2/5 Column 4 needs 2 square(s) and already has 2
81 column count empty h4/4 Column 4 needs 2 square(s) and already has 2
82 column count empty v3/5 Column 4 needs 2 square(s) and already has 2
83 column count empty h5/4 Column 4 needs 2 square(s) and already has 2
84 column count empty v4/5 Column 4 needs 2 square(s) and already has 2
85 column count empty h6/4 Column 4 needs 2 square(s) and already has 2
86 column count empty v5/5 Column 4 needs 2 square(s) and already has 2
87 column count empty h7/4 Column 4 needs 2 square(s) and already has 2
88 column count empty v6/5 Column 4 needs 2 square(s) and already has 2
89 column count empty h8/4 Column 4 needs 2 square(s) and already has 2
90 column count empty v7/5 Column 4 needs 2 square(s) and already has 2
91 column count empty h9/4 Column 4 needs 2 square(s) and already has 2
92 column count empty v8/5 Column 4 needs 2 square(s) and already has 2
93 column count empty h10/4 Column 4 needs 2 square(s) and already has 2
94 column count empty v9/5 Column 4 needs 2 square(s) and already has 2
95 column count empty h11/4 Column 4 needs 2 square(s) and already has 2
96 column count empty v10/5 Column 4 needs 2 square(s) and already has 2
97 column count empty h12/4 Column 4 needs 2 square(s) and already has 2
98 column count empty v11/5 Column 4 needs 2 square(s) and already has 2
99 cell degree rail v1/5 r1c4 still needs 1 rail joint(s) and has only 1 undecided side(s)
100 cell degree rail v12/5 r12c4 still needs 1 rail joint(s) and has only 1 undecided side(s)
101 column count empty h2/5 Column 5 needs 2 square(s) and already has 2
102 column count empty h3/5 Column 5 needs 2 square(s) and already has 2
103 column count empty v2/6 Column 5 needs 2 square(s) and already has 2
104 column count empty h4/5 Column 5 needs 2 square(s) and already has 2
105 column count empty v3/6 Column 5 needs 2 square(s) and already has 2
106 column count empty h5/5 Column 5 needs 2 square(s) and already has 2
107 column count empty v4/6 Column 5 needs 2 square(s) and already has 2
108 column count empty h6/5 Column 5 needs 2 square(s) and already has 2
109 column count empty v5/6 Column 5 needs 2 square(s) and already has 2
110 column count empty h7/5 Column 5 needs 2 square(s) and already has 2
111 column count empty v6/6 Column 5 needs 2 square(s) and already has 2
112 column count empty h8/5 Column 5 needs 2 square(s) and already has 2
113 column count empty v7/6 Column 5 needs 2 square(s) and already has 2
114 column count empty h9/5 Column 5 needs 2 square(s) and already has 2
115 column count empty v8/6 Column 5 needs 2 square(s) and already has 2
116 column count empty h10/5 Column 5 needs 2 square(s) and already has 2
117 column count empty v9/6 Column 5 needs 2 square(s) and already has 2
118 column count empty h11/5 Column 5 needs 2 square(s) and already has 2
119 column count empty v10/6 Column 5 needs 2 square(s) and already has 2
120 column count empty h12/5 Column 5 needs 2 square(s) and already has 2
121 column count empty v11/6 Column 5 needs 2 square(s) and already has 2
122 cell degree rail v1/6 r1c5 still needs 1 rail joint(s) and has only 1 undecided side(s)
123 cell degree rail v12/6 r12c5 still needs 1 rail joint(s) and has only 1 undecided side(s)
124 column count empty h2/6 Column 6 needs 2 square(s) and already has 2
125 column count empty h3/6 Column 6 needs 2 square(s) and already has 2
126 column count empty v2/7 Column 6 needs 2 square(s) and already has 2
127 column count empty h4/6 Column 6 needs 2 square(s) and already has 2
128 column count empty v3/7 Column 6 needs 2 square(s) and already has 2
129 column count empty h5/6 Column 6 needs 2 square(s) and already has 2
130 column count empty v4/7 Column 6 needs 2 square(s) and already has 2
131 column count empty h6/6 Column 6 needs 2 square(s) and already has 2
132 column count empty v5/7 Column 6 needs 2 square(s) and already has 2
133 column count empty h7/6 Column 6 needs 2 square(s) and already has 2
134 column count empty v6/7 Column 6 needs 2 square(s) and already has 2
135 column count empty h8/6 Column 6 needs 2 square(s) and already has 2
136 column count empty v7/7 Column 6 needs 2 square(s) and already has 2
137 column count empty h9/6 Column 6 needs 2 square(s) and already has 2
138 column count empty v8/7 Column 6 needs 2 square(s) and already has 2
139 column count empty h10/6 Column 6 needs 2 square(s) and already has 2
140 column count empty v9/7 Column 6 needs 2 square(s) and already has 2
141 column count empty h11/6 Column 6 needs 2 square(s) and already has 2
142 column count empty v10/7 Column 6 needs 2 square(s) and already has 2
143 column count empty h12/6 Column 6 needs 2 square(s) and already has 2
144 column count empty v11/7 Column 6 needs 2 square(s) and already has 2
145 cell degree rail v1/7 r1c6 still needs 1 rail joint(s) and has only 1 undecided side(s)
146 cell degree rail v12/7 r12c6 still needs 1 rail joint(s) and has only 1 undecided side(s)
147 column count empty h2/7 Column 7 needs 2 square(s) and already has 2
148 column count empty h3/7 Column 7 needs 2 square(s) and already has 2
149 column count empty v2/8 Column 7 needs 2 square(s) and already has 2
150 column count empty h4/7 Column 7 needs 2 square(s) and already has 2
151 column count empty v3/8 Column 7 needs 2 square(s) and already has 2
152 column count empty h5/7 Column 7 needs 2 square(s) and already has 2
153 column count empty v4/8 Column 7 needs 2 square(s) and already has 2
154 column count empty h6/7 Column 7 needs 2 square(s) and already has 2
155 column count empty v5/8 Column 7 needs 2 square(s) and already has 2
156 column count empty h7/7 Column 7 needs 2 square(s) and already has 2
157 column count empty v6/8 Column 7 needs 2 square(s) and already has 2
158 column count empty h8/7 Column 7 needs 2 square(s) and already has 2
159 column count empty v7/8 Column 7 needs 2 square(s) and already has 2
160 column count empty h9/7 Column 7 needs 2 square(s) and already has 2
161 column count empty v8/8 Column 7 needs 2 square(s) and already has 2
162 column count empty h10/7 Column 7 needs 2 square(s) and already has 2
163 column count empty v9/8 Column 7 needs 2 square(s) and already has 2
164 column count empty h11/7 Column 7 needs 2 square(s) and already has 2
165 column count empty v10/8 Column 7 needs 2 square(s) and already has 2
166 column count empty h12/7 Column 7 needs 2 square(s) and already has 2
167 column count empty v11/8 Column 7 needs 2 square(s) and already has 2
168 cell degree rail v1/8 r1c7 still needs 1 rail joint(s) and has only 1 undecided side(s)
169 cell degree rail v12/8 r12c7 still needs 1 rail joint(s) and has only 1 undecided side(s)
170 column count empty h2/8 Column 8 needs 2 square(s) and already has 2
171 column count empty h3/8 Column 8 needs 2 square(s) and already has 2
172 column count empty v2/9 Column 8 needs 2 square(s) and already has 2
173 column count empty h4/8 Column 8 needs 2 square(s) and already has 2
174 column count empty v3/9 Column 8 needs 2 square(s) and already has 2
175 column count empty h5/8 Column 8 needs 2 square(s) and already has 2
176 column count empty v4/9 Column 8 needs 2 square(s) and already has 2
177 column count empty h6/8 Column 8 needs 2 square(s) and already has 2
178 column count empty v5/9 Column 8 needs 2 square(s) and already has 2
179 column count empty h7/8 Column 8 needs 2 square(s) and already has 2
180 column count empty v6/9 Column 8 needs 2 square(s) and already has 2
181 column count empty h8/8 Column 8 needs 2 square(s) and already has 2
182 column count empty v7/9 Column 8 needs 2 square(s) and already has 2
183 column count empty h9/8 Column 8 needs 2 square(s) and already has 2
184 column count empty v8/9 Column 8 needs 2 square(s) and already has 2
185 column count empty h10/8 Column 8 needs 2 square(s) and already has 2
186 column count empty v9/9 Column 8 needs 2 square(s) and already has 2
187 column count empty h11/8 Column 8 needs 2 square(s) and already has 2
188 column count empty v10/9 Column 8 needs 2 square(s) and already has 2
189 column count empty h12/8 Column 8 needs 2 square(s) and already has 2
190 column count empty v11/9 Column 8 needs 2 square(s) and already has 2
191 cell degree rail v1/9 r1c8 still needs 1 rail joint(s) and has only 1 undecided side(s)
192 cell degree empty h2/9 r1c9 already has 2 rail joint(s)
193 cell degree rail v12/9 r12c8 still needs 1 rail joint(s) and has only 1 undecided side(s)
194 column count empty h3/9 Column 9 needs 2 square(s) and already has 2
195 column count empty v2/10 Column 9 needs 2 square(s) and already has 2
196 column count empty h4/9 Column 9 needs 2 square(s) and already has 2
197 column count empty v3/10 Column 9 needs 2 square(s) and already has 2
198 column count empty h5/9 Column 9 needs 2 square(s) and already has 2
199 column count empty v4/10 Column 9 needs 2 square(s) and already has 2
200 column count empty h6/9 Column 9 needs 2 square(s) and already has 2
201 column count empty v5/10 Column 9 needs 2 square(s) and already has 2
202 column count empty h7/9 Column 9 needs 2 square(s) and already has 2
203 column count empty v6/10 Column 9 needs 2 square(s) and already has 2
204 column count empty h8/9 Column 9 needs 2 square(s) and already has 2
205 column count empty v7/10 Column 9 needs 2 square(s) and already has 2
206 column count empty h9/9 Column 9 needs 2 square(s) and already has 2
207 column count empty v8/10 Column 9 needs 2 square(s) and already has 2
208 column count empty h10/9 Column 9 needs 2 square(s) and already has 2
209 column count empty v9/10 Column 9 needs 2 square(s) and already has 2
210 column count empty h11/9 Column 9 needs 2 square(s) and already has 2
211 column count empty v10/10 Column 9 needs 2 square(s) and already has 2
212 column count empty h12/9 Column 9 needs 2 square(s) and already has 2
213 column count empty v11/10 Column 9 needs 2 square(s) and already has 2
214 cell degree rail v12/10 r12c9 still needs 1 rail joint(s) and has only 1 undecided side(s)
215 cell degree empty h12/10 r12c10 already has 1 rail joint(s)
216 cell degree empty v12/11 r12c10 already has 1 rail joint(s)
217 cell degree rail h12/11 r12c11 still needs 1 rail joint(s) and has only 1 undecided side(s)
218 row count empty h11/10 Row 11 needs 3 square(s) and already has 3
219 row count empty v11/11 Row 11 needs 3 square(s) and already has 3
220 column count empty h3/10 Column 10 needs 3 square(s) and already has 3
221 column count empty h4/10 Column 10 needs 3 square(s) and already has 3
222 column count empty v3/11 Column 10 needs 3 square(s) and already has 3
223 column count empty h5/10 Column 10 needs 3 square(s) and already has 3
224 column count empty v4/11 Column 10 needs 3 square(s) and already has 3
225 column count empty h6/10 Column 10 needs 3 square(s) and already has 3
226 column count empty v5/11 Column 10 needs 3 square(s) and already has 3
227 column count empty h7/10 Column 10 needs 3 square(s) and already has 3
228 column count empty v6/11 Column 10 needs 3 square(s) and already has 3
229 column count empty h8/10 Column 10 needs 3 square(s) and already has 3
230 column count empty v7/11 Column 10 needs 3 square(s) and already has 3
231 column count empty h9/10 Column 10 needs 3 square(s) and already has 3
232 column count empty v8/11 Column 10 needs 3 square(s) and already has 3
233 column count empty h10/10 Column 10 needs 3 square(s) and already has 3
234 column count empty v9/11 Column 10 needs 3 square(s) and already has 3
235 column count empty v10/11 Column 10 needs 3 square(s) and already has 3
236 cell degree rail v2/11 r2c10 still needs 1 rail joint(s) and has only 1 undecided side(s)
237 contradiction rail h3/11 Assuming no rail on this side leads to a contradiction
238 cell degree empty v2/12 r2c11 already has 2 rail joint(s)
239 cell degree rail h3/12 r2c12 still needs 1 rail joint(s) and has only 1 undecided side(s)
240 contradiction rail h4/11 Assuming no rail on this side leads to a contradiction
241 cell degree empty v3/12 r3c11 already has 2 rail joint(s)
242 cell degree rail h4/12 r3c12 still needs 1 rail joint(s) and has only 1 undecided side(s)
243 contradiction rail h5/11 Assuming no rail on this side leads to a contradiction
244 cell degree empty v4/12 r4c11 already has 2 rail joint(s)
245 cell degree rail h5/12 r4c12 still needs 1 rail joint(s) and has only 1 undecided side(s)
246 contradiction rail h6/11 Assuming no rail on this side leads to a contradiction
247 cell degree empty v5/12 r5c11 already has 2 rail joint(s)
248 cell degree rail h6/12 r5c12 still needs 1 rail joint(s) and has only 1 undecided side(s)
249 contradiction rail h7/11 Assuming no rail on this side leads to a contradiction
250 cell degree empty v6/12 r6c11 already has 2 rail joint(s)
251 cell degree rail h7/12 r6c12 still needs 1 rail joint(s) and has only 1 undecided side(s)
252 contradiction rail h8/11 Assuming no rail on this side leads to a contradiction
253 cell degree empty v7/12 r7c11 already has 2 rail joint(s)
254 cell degree rail h8/12 r7c12 still needs 1 rail joint(s) and has only 1 undecided side(s)
255 contradiction rail h9/11 Assuming no rail on this side leads to a contradiction
256 cell degree empty v8/12 r8c11 already has 2 rail joint(s)
257 cell degree rail h9/12 r8c12 still needs 1 rail joint(s) and has only 1 undecided side(s)
258 contradiction rail h10/11 Assuming no rail on this side leads to a contradiction
259 cell degree empty v9/12 r9c11 already has 2 rail joint(s)
260 cell degree rail h10/12 r9c12 still needs 1 rail joint(s) and has only 1 undecided side(s)
261 contradiction rail h11/11 Assuming no rail on this side leads to a contradiction
262 cell degree empty v10/12 r10c11 already has 2 rail joint(s)
263 cell degree rail h11/12 r10c12 still needs 1 rail joint(s) and has only 1 undecided side(s)
264 cell degree empty v11/12 r11c11 already has 2 rail joint(s)

GridPaw's Tracks boards are generated to be unique and guess-free; the engine behind them is our own, written for this site. Play Train Tracks when you would rather solve one than read one.