Box the compass: Difference between revisions

Content added Content deleted
m (→‎{{header|Tcl}}: prettier!)
Line 241: Line 241:
=={{header|Python}}==
=={{header|Python}}==
<lang python>majors = 'north east south west'.split()
<lang python>majors = 'north east south west'.split()
majors = majors + majors # no need for modulo later
majors *= 2 # no need for modulo later
quarter1 = 'N,N by E,N-NE,NE by N,NE,NE by E,E-NE,E by N'.split(',')
quarter1 = 'N,N by E,N-NE,NE by N,NE,NE by E,E-NE,E by N'.split(',')
quarter2 = [p.replace('NE','EN') for p in quarter1]
quarter2 = [p.replace('NE','EN') for p in quarter1]