Magic squares of doubly even order: Difference between revisions

Content added Content deleted
m (correct the FreeBasic header)
m (→‎{{header|Perl 6}}: Meh. tried to be cute and ended up wrong. undo)
Line 214: Line 214:


=={{header|Perl 6}}==
=={{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.
See [[Magic_squares/Perl_6|Magic squares/Perl 6]] for a general magic square generator.
{{out}}
{{out}}
With a parameter of 8:
With a parameter of 8:
<pre>54 16 53 52 10 9 15 51
<pre> 1 2 62 61 60 59 7 8
27 33 28 29 39 40 34 30
9 10 54 53 52 51 15 16
19 41 20 21 47 48 42 22
48 47 19 20 21 22 42 41
35 25 36 37 31 32 26 38
40 39 27 28 29 30 34 33
62 8 61 60 2 1 7 59
32 31 35 36 37 38 26 25
6 64 5 4 58 57 63 3
24 23 43 44 45 46 18 17
43 17 44 45 23 24 18 46
49 50 14 13 12 11 55 56
14 56 13 12 50 49 55 11
57 58 6 5 4 3 63 64


The magic number is 260</pre>
The magic number is 260</pre>
With a parameter of 12:
With a parameter of 12:
<pre> 36 27 116 26 117 113 112 34 115 114 35 25
<pre> 1 2 3 141 140 139 138 137 136 10 11 12
144 135 8 134 9 5 4 142 7 6 143 133
13 14 15 129 128 127 126 125 124 22 23 24
85 94 53 95 52 56 57 87 54 55 86 96
25 26 27 117 116 115 114 113 112 34 35 36
61 70 77 71 76 80 81 63 78 79 62 72
108 107 106 40 41 42 43 44 45 99 98 97
24 15 128 14 129 125 124 22 127 126 23 13
96 95 94 52 53 54 55 56 57 87 86 85
120 111 32 110 33 29 28 118 31 30 119 109
84 83 82 64 65 66 67 68 69 75 74 73
37 46 101 47 100 104 105 39 102 103 38 48
72 71 70 76 77 78 79 80 81 63 62 61
132 123 20 122 21 17 16 130 19 18 131 121
60 59 58 88 89 90 91 92 93 51 50 49
97 106 41 107 40 44 45 99 42 43 98 108
48 47 46 100 101 102 103 104 105 39 38 37
12 3 140 2 141 137 136 10 139 138 11 1
109 110 111 33 32 31 30 29 28 118 119 120
73 82 65 83 64 68 69 75 66 67 74 84
121 122 123 21 20 19 18 17 16 130 131 132
49 58 89 59 88 92 93 51 90 91 50 60
133 134 135 9 8 7 6 5 4 142 143 144


The magic number is 870
The magic number is 870</pre>

</pre>


=={{header|REXX}}==
=={{header|REXX}}==