Magic squares of doubly even order: Difference between revisions
Magic squares of doubly even order (view source)
Revision as of 16:01, 10 December 2016
, 7 years ago→{{header|Haskell}}
m (→JS ES6: (Restored the testing of three orders – 4, 8, 12)) |
|||
Line 282:
=={{header|Haskell}}==
<lang Haskell>
magicSquare :: Int -> [[Int]]
Line 315 ⟶ 313:
magicSeries :: Int -> [Bool]
magicSeries n
| n <=
| otherwise = xs ++ (not <$> xs)
where
Line 342 ⟶ 340:
where
square = magicSquare n
(transpose square) ++ -- cols
(diagonals square) -- diagonals
|