Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
28
Task/Box-the-compass/11l/box-the-compass.11l
Normal file
28
Task/Box-the-compass/11l/box-the-compass.11l
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
V majors = ‘north east south west’.split(‘ ’)
|
||||
majors *= 2
|
||||
V quarter1 = ‘N,N by E,N-NE,NE by N,NE,NE by E,E-NE,E by N’.split(‘,’)
|
||||
V quarter2 = quarter1.map(p -> p.replace(‘NE’, ‘EN’))
|
||||
|
||||
F degrees2compasspoint(=d)
|
||||
d = (d % 360) + 360 / 64
|
||||
V majorindex = Int(d / 90)
|
||||
V minorindex = Int((d % 90 * 4) I/ 45)
|
||||
V p1 = :majors[majorindex]
|
||||
V p2 = :majors[majorindex + 1]
|
||||
[String] q
|
||||
I p1 C (‘north’, ‘south’)
|
||||
q = :quarter1
|
||||
E
|
||||
q = :quarter2
|
||||
R q[minorindex].replace(‘N’, p1).replace(‘E’, p2).capitalize()
|
||||
|
||||
:start:
|
||||
L(i) 33
|
||||
V d = i * 11.25
|
||||
S i % 3
|
||||
1
|
||||
d += 5.62
|
||||
2
|
||||
d -= 5.62
|
||||
V n = i % 32 + 1
|
||||
print(‘#2.0 #<18 #4.2°’.format(n, degrees2compasspoint(d), d))
|
||||
Loading…
Add table
Add a link
Reference in a new issue