Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Box-the-compass/Sidef/box-the-compass.sidef
Normal file
15
Task/Box-the-compass/Sidef/box-the-compass.sidef
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
func point (index) {
|
||||
var ix = (index % 32);
|
||||
if (ix & 1) { "#{point((ix + 1) & 28)} by #{point(((2 - (ix & 2)) * 4) + ix & 24)}" }
|
||||
elsif (ix & 2) { "#{point((ix + 2) & 24)}-#{point((ix | 4) & 28)}" }
|
||||
elsif (ix & 4) { "#{point((ix + 8) & 16)}#{point((ix | 8) & 24)}" }
|
||||
else { <north east south west>[ix / 8] }
|
||||
}
|
||||
|
||||
func test_angle (ix) { ix * 11.25 + [0, 5.62, -5.62][ ix % 3 ] };
|
||||
func angle_to_point(𝜽) { (𝜽 / 360 * 32) + 0.5 -> floor };
|
||||
|
||||
for ix in range(0, 32) {
|
||||
var 𝜽 = test_angle(ix);
|
||||
printf(" %2d %6.2f° %s\n", ix % 32 + 1, 𝜽, point(angle_to_point(𝜽)).tc);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue