Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,26 @@
with(ArrayTools):
spiralArray := proc(size::integer)
local M, sideLength, count, i, j:
M := Matrix(size):
count := 0:
sideLength := size:
for i from 1 to ceil(sideLength / 2) do
for j from 1 to sideLength do
M[i,i + j - 1] := count++:
end:
for j from 1 to sideLength - 1 do
M[i + j, sideLength + i - 1] := count++:
end:
for j from 1 to sideLength - 1 do
M[i + sideLength - 1, sideLength - j + i - 1] := count++:
end:
for j from 1 to sideLength - 2 do
M[sideLength + i - j - 1, i] := count++
end:
sideLength -= 2:
end:
return M;
end proc:
spiralArray(5);