Magic squares of doubly even order: Difference between revisions
Content deleted Content added
Thundergnat (talk | contribs) m →{{header|C}}: Remove vanity tags |
Added Befunge example. |
||
Line 391: | Line 391: | ||
| 8 || 58 || 59 || 5 || 61 || 3 || 2 || 64 |
| 8 || 58 || 59 || 5 || 61 || 3 || 2 || 64 |
||
|} |
|} |
||
=={{header|Befunge}}== |
|||
The size, ''N'', is specified by the first value on the stack. The algorithm is loosely based on the [[Magic_squares_of_doubly_even_order#Java|Java]] implementation. |
|||
<lang befunge>8>>>v>10p00g:*1-*\110g2*-*+1+.:00g%!9+,:#v_@ |
|||
p00:<^:!!-!%3//4g00%g00\!!%3/*:g00*4:::-1<*:</lang> |
|||
{{out}} |
|||
<pre>1 2 62 61 60 59 7 8 |
|||
9 10 54 53 52 51 15 16 |
|||
48 47 19 20 21 22 42 41 |
|||
40 39 27 28 29 30 34 33 |
|||
32 31 35 36 37 38 26 25 |
|||
24 23 43 44 45 46 18 17 |
|||
49 50 14 13 12 11 55 56 |
|||
57 58 6 5 4 3 63 64</pre> |
|||
=={{header|C}}== |
=={{header|C}}== |