Anonymous user
Railway circuit: Difference between revisions
m
added whitespace and highlighting, corrected a typo, added an Oxford comma, aligned examples.
m (added whitespace and highlighting, corrected a typo, added an Oxford comma, aligned examples.) |
|||
Line 1:
{{draft task}}
'''Railway circuit'''▼
Given n sections of curve tracks, each one being an arc of 30° of radius R, the goal is to build and count all possible different railway circuits.▼
Given '''n''' sections of curve tracks, each one being an arc of '''30°''' of radius '''R'''.
▲
'''Constraints''' :▼
* n = 12 + k*4 (k = 0, 1 , ...)▼
* The circuit must be a closed, connected graph, and the last arc must joint the first one▼
* Duplicates, either by symmetry, translation, reflexion or rotation must be eliminated.▼
▲* The circuit must be a closed, connected graph, and the last arc must
* Paths may overlap or cross each other.▼
▲* Duplicates, either by symmetry, translation, reflexion, or rotation must be eliminated.
* All tracks must be used.▼
▲* Paths may overlap or cross each other.
▲* All tracks must be used.
http://www.echolalie.org/echolisp/duplo.html
Write a function which counts and displays all possible circuits '''Cn''' for '''n''' = 12, 16, 20.
A circuit '''Cn''' will be displayed as a list, or sequence of '''n''' Right=1/Left=-1 turns.
;Examples:
C12 = (1,1,1,1,1,1,1,1,1,1,1,1) or C12 = (-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1)▼
:::: C12 = (1,1,1,1,1,1,1,1,1,1,1,1) and
Suppose we have '''m''' = k*2 sections of straight tracks, each of length L.
Such a circuit is denoted '''Cn,m'''
A circuit is a sequence of +1, -1, or 0 = straight move.
<br><br>
=={{header|EchoLisp}}==
|