Anonymous user
Magic squares of doubly even order: Difference between revisions
m
→{{header|Java}}: small changes
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: Meh. tried to be cute and ended up wrong. undo) |
m (→{{header|Java}}: small changes) |
||
Line 186:
// pattern of count-up vs count-down zones
int bits =
int size = n * n;
int mult = n / 4; // how many multiples of 4
Line 194:
for (int r = 0, i = 0; r < n; r++) {
for (int c = 0; c < n; c++, i++) {
int
result[r][c] = (bits & (1 <<
}
}
|