Jump to content

Box the compass: Difference between revisions

 
Line 3,773:
=={{header|langur}}==
{{trans|D}}
<syntaxhighlight lang="langur">val .box = ["North", "North by east", "North-northeast", "Northeast by north",
"Northeast", "Northeast by east", "East-northeast", "East by north",
"East", "East by south", "East-southeast", "Southeast by east",
Line 3,782:
"Northwest", "Northwest by north", "North-northwest", "North by west"]
 
val .angles = [
0.0, 16.87, 16.88, 33.75, 50.62, 50.63, 67.5, 84.37, 84.38,
101.25, 118.12, 118.13, 135.0, 151.87, 151.88, 168.75, 185.62,
Line 3,791:
writeln "----- ------- -------------"
 
for .phi in .angles {
val .i = trunc(.phi * 32 / 360 + 0.5) rem 32 + 1
writeln "{{.i:5}} {{.phi:r2:6}} {{.box[.i]}}"
}
}</syntaxhighlight>
 
{{out}}
990

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.