How to resolve the algorithm Box the compass step by step in the PARI/GP programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Box the compass step by step in the PARI/GP programming language
Table of Contents
Problem Statement
There be many a land lubber that knows naught of the pirate ways and gives direction by degree! They know not how to box the compass!
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Box the compass step by step in the PARI/GP programming language
Source code in the pari/gp programming language
box(x)={["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","Southeast","Southeast by south","South-southeast","South by east","South",
"South by west","South-southwest","Southwest by south","Southwest","Southwest by west","West-southwest",
"West by south","West","West by north","West-northwest","Northwest by west","Northwest",
"Northwest by north","North-northwest","North by west"][round(x*4/45)%32+1]};
for(i=0,32,print(i%32+1" "box(x=i*11.25+if(i%3==1,5.62,if(i%3==2,-5.62)))" "x))
You may also check:How to resolve the algorithm Comments step by step in the Apex programming language
You may also check:How to resolve the algorithm Add a variable to a class instance at runtime step by step in the Pop11 programming language
You may also check:How to resolve the algorithm Empty program step by step in the Phix programming language
You may also check:How to resolve the algorithm Sequence of non-squares step by step in the Maxima programming language
You may also check:How to resolve the algorithm Monte Carlo methods step by step in the J programming language