Magic squares of doubly even order: Difference between revisions

m
→‎{{header|Perl 6}}: Update example
m (→‎{{header|Java}}: small change)
m (→‎{{header|Perl 6}}: Update example)
Line 81:
 
=={{header|Perl 6}}==
See [[Magic_squares/Perl_6|Magic squares/Perl 6]] for a general magic square generator. Note that it produces '''a''' magic square, not '''the''' magic square. The output is different each time.
{{out}}
With a parameter of 8:
<pre>54 116 53 252 6210 61 609 5915 7 851
927 1033 5428 5329 5239 5140 1534 1630
48 47 19 41 20 21 2247 48 42 4122
4035 3925 2736 2837 2931 3032 3426 3338
3262 31 358 3661 3760 38 262 25 1 7 59
24 6 2364 43 445 45 464 1858 1757 63 3
4943 5017 1444 1345 1223 1124 5518 5646
5714 5856 13 612 50 549 55 4 3 63 6411
 
The magic number is 260</pre>
With a parameter of 12:
<pre> 36 27 116 26 117 113 112 34 115 114 35 25
144 135 8 134 9 5 4 142 7 6 143 133
85 94 53 95 52 56 57 87 54 55 86 96
61 70 77 71 76 80 81 63 78 79 62 72
24 15 128 14 129 125 124 22 127 126 23 13
120 111 32 110 33 29 28 118 31 30 119 109
37 46 101 47 100 104 105 39 102 103 38 48
132 123 20 122 21 17 16 130 19 18 131 121
97 106 41 107 40 44 45 99 42 43 98 108
12 3 140 2 141 137 136 10 139 138 11 1
73 82 65 83 64 68 69 75 66 67 74 84
49 58 89 59 88 92 93 51 90 91 50 60
 
The magic number is 870
 
</pre>
 
=={{header|REXX}}==
10,333

edits