Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Box-the-compass/AWK/box-the-compass.awk
Normal file
18
Task/Box-the-compass/AWK/box-the-compass.awk
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/awk -f
|
||||
BEGIN {
|
||||
split("N NbE NNE NEbN NE NEbE ENE EbN E EbS ESE SEbE SE SEbS SSE SbE S SbW SSW SWbS SW SWbW WSW WbS W WbN WNW NWbW NW NWbN NNW NbW",A," ");
|
||||
}
|
||||
|
||||
function ceil(x) {
|
||||
y = int(x)
|
||||
return y < x ? y + 1 : y
|
||||
}
|
||||
|
||||
function compassbox(d) {
|
||||
return ceil( ( (d + 360 / 64) % 360) * 32 / 360);
|
||||
}
|
||||
|
||||
{
|
||||
box = compassbox($1);
|
||||
printf "%6.2f : %2d\t%s\n",$1,box,A[box];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue