Box the compass: Difference between revisions

Line 3,218:
 
=={{header|langur}}==
{{works with|langur|0.6.8}}
<lang langur>val .box = ["North", "North by east", "North-northeast", "Northeast by north",
"Northeast", "Northeast by east", "East-northeast", "East by north",
Line 3,232 ⟶ 3,233:
185.63, 202.5, 219.37, 219.38, 236.25, 253.12, 253.13, 270.0,
286.87, 286.88, 303.75, 320.62, 320.63, 337.5, 354.37, 354.38]
 
val .padL = f(.s, .with, .len) .with x (.len - len(.s)) ~ .s
 
for .phi in .angles {
val .i = truncate(.phi x 32 / 360 + 0.5) rem 32 + 1
writeln $"\.padL(toString(.i), " ", :2); \.padL(.box[.i], " ", :18); \.phi;"
}</lang>
 
890

edits