Talk:Railway circuit: Difference between revisions

→‎All solutions are wrong: added some explanations
(→‎All solutions are wrong: short example code)
(→‎All solutions are wrong: added some explanations)
Line 252:
sequences = lambda n: product(*([(1, 0, -1)]*n))
 
# Check the track combination is valid.
# This treatment requires the straight segment length equal the chord lengths of the arcs,
# otherwise the math is MUCH more complicated.
def valid(s):
# a is the right turn count after each step