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'''
 
''';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'''.
 
Given n sections of curve tracks, each one being an arc of 30° of radius R, theThe goal is to build and count all possible different railway circuits.
'''Constraints''' :
 
 
* n = 12 + k*4 (k = 0, 1 , ...)
''';Constraints''' :
* The circuit must be a closed, connected graph, and the last arc must joint the first one
*   '''n''' = 12 + k*4     (k = 0, 1 ,  ...)
* Duplicates, either by symmetry, translation, reflexion or rotation must be eliminated.
*   The circuit must be a closed, connected graph, and the last arc must jointjoin the first one
* 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.
 
''';Illustrations''' : http://www.echolalie.org/echolisp/duplo.html
http://www.echolalie.org/echolisp/duplo.html
 
''';Task:'''
Write a function which counts and displays all possible circuits   '''Cn'''   for   '''n''' = 12, 16, 20.
 
Write a function which counts and displays all possible circuits Cn for n = 12, 16 , 20. Extra credit for   '''n''' = 24, 28, ... 48     (no display, only counts). A circuit Cn will be displayed as a list, or sequence of n Right=1/Left=-1 turns.
 
A circuit   '''Cn'''   will be displayed as a list, or sequence of   '''n'''   Right=1/Left=-1 turns.
Example:
 
;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
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)
 
''';Straight tracks (extra-extra credit)''':
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.
 
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. Count the number of circuits   '''Cn,m'''   with   '''n'''   same as above and   '''m''' = 2  to  8 .
<br><br>
 
=={{header|EchoLisp}}==