Magic squares of odd order: Difference between revisions
Content added Content deleted
m (→{{header|Wren}}: Minor tidy) |
(Added Easylang) |
||
Line 2,325: | Line 2,325: | ||
21 23 32 41 43 3 12 |
21 23 32 41 43 3 12 |
||
22 31 40 49 2 11 20</pre> |
22 31 40 49 2 11 20</pre> |
||
=={{header|EasyLang}}== |
|||
{{trans|C}} |
|||
<syntaxhighlight> |
|||
func f n x y . |
|||
return (x + y * 2 + 1) mod n |
|||
. |
|||
numfmt 0 3 |
|||
proc msqr n . . |
|||
for i = 0 to n - 1 |
|||
for j = 0 to n - 1 |
|||
write f n (n - j - 1) i * n + f n j i + 1 |
|||
. |
|||
print "" |
|||
. |
|||
. |
|||
msqr 5 |
|||
</syntaxhighlight> |
|||
{{out}} |
|||
<pre> |
|||
2 23 19 15 6 |
|||
14 10 1 22 18 |
|||
21 17 13 9 5 |
|||
8 4 25 16 12 |
|||
20 11 7 3 24 |
|||
</pre> |
|||
=={{header|EchoLisp}}== |
=={{header|EchoLisp}}== |