Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Box-the-compass/Zkl/box-the-compass.zkl
Normal file
17
Task/Box-the-compass/Zkl/box-the-compass.zkl
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
A:=("X N NbE NNE NEbN NE NEbE ENE EbN E EbS ESE " // one based array
|
||||
"SEbE SE SEbS SSE SbE S SbW SSW SWbS SW SWbW "
|
||||
"WSW WbS W WbN WNW NWbW NW NWbN NNW NbW").split(" ");
|
||||
|
||||
fcn compassBox(d){
|
||||
return(( ( (d + 360.0 / 64.0) % 360.0) * 32.0 / 360.0).ceil());
|
||||
}
|
||||
|
||||
foreach i in ([0..32]){
|
||||
heading:=11.25*i;
|
||||
switch(i%3){ // or heading+=5.62*((i+1).divr(3)[1]-1);
|
||||
case(1){ heading+=5.62 }
|
||||
case(2){ heading-=5.62 }
|
||||
}
|
||||
box:=compassBox(heading);
|
||||
println("%6.2f\UB0; : %2d\t%s".fmt(heading,box,A[box]));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue