Box the compass: Difference between revisions
Content added Content deleted
Langurmonkey (talk | contribs) |
Langurmonkey (talk | contribs) (→{{header|langur}}: modified output) |
||
Line 3,218: | Line 3,218: | ||
=={{header|langur}}== |
=={{header|langur}}== |
||
{{works with|langur|0.6. |
{{works with|langur|0.6.13}} |
||
<lang langur>val .box = ["North", "North by east", "North-northeast", "Northeast by north", |
<lang langur>val .box = ["North", "North by east", "North-northeast", "Northeast by north", |
||
"Northeast", "Northeast by east", "East-northeast", "East by north", |
"Northeast", "Northeast by east", "East-northeast", "East by north", |
||
Line 3,233: | Line 3,233: | ||
185.63, 202.5, 219.37, 219.38, 236.25, 253.12, 253.13, 270.0, |
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] |
286.87, 286.88, 303.75, 320.62, 320.63, 337.5, 354.37, 354.38] |
||
writeln "index degrees compass point" |
|||
writeln "----- ------- -------------" |
|||
for .phi in .angles { |
for .phi in .angles { |
||
val .i = truncate(.phi x 32 / 360 + 0.5) rem 32 + 1 |
val .i = truncate(.phi x 32 / 360 + 0.5) rem 32 + 1 |
||
writeln $"\.i: |
writeln $"\.i:5; \.phi:r2:6; \.box[.i];" |
||
}</lang> |
}</lang> |
||
{{out}} |
{{out}} |
||
<pre> |
<pre>index degrees compass point |
||
----- ------- ------------- |
|||
2 North by east 16.87 |
|||
1 0.00 North |
|||
3 North-northeast 16.88 |
|||
2 16.87 North by east |
|||
4 Northeast by north 33.75 |
|||
3 16.88 North-northeast |
|||
4 33.75 Northeast by north |
|||
6 Northeast by east 50.63 |
|||
5 50.62 Northeast |
|||
7 East-northeast 67.5 |
|||
6 50.63 Northeast by east |
|||
7 67.50 East-northeast |
|||
8 84.37 East by north |
|||
9 84.38 East |
|||
11 East-southeast 118.12 |
|||
10 101.25 East by south |
|||
12 Southeast by east 118.13 |
|||
11 118.12 East-southeast |
|||
12 118.13 Southeast by east |
|||
14 Southeast by south 151.87 |
|||
13 135.00 Southeast |
|||
15 South-southeast 151.88 |
|||
14 151.87 Southeast by south |
|||
16 South by east 168.75 |
|||
15 151.88 South-southeast |
|||
16 168.75 South by east |
|||
17 185.62 South |
|||
19 South-southwest 202.5 |
|||
18 185.63 South by west |
|||
20 Southwest by south 219.37 |
|||
19 202.50 South-southwest |
|||
20 219.37 Southwest by south |
|||
22 Southwest by west 236.25 |
|||
21 219.38 Southwest |
|||
23 West-southwest 253.12 |
|||
22 236.25 Southwest by west |
|||
24 West by south 253.13 |
|||
23 253.12 West-southwest |
|||
24 253.13 West by south |
|||
25 270.00 West |
|||
27 West-northwest 286.88 |
|||
26 286.87 West by north |
|||
28 Northwest by west 303.75 |
|||
27 286.88 West-northwest |
|||
28 303.75 Northwest by west |
|||
30 Northwest by north 320.63 |
|||
29 320.62 Northwest |
|||
31 North-northwest 337.5 |
|||
30 320.63 Northwest by north |
|||
⚫ | |||
31 337.50 North-northwest |
|||
⚫ | |||
1 354.38 North |
|||
</pre> |
|||
=={{header|Liberty BASIC}}== |
=={{header|Liberty BASIC}}== |