Magic squares of doubly even order: Difference between revisions

m
m (→‎JS ES6: (Restored the testing of three orders – 4, 8, 12))
Line 282:
=={{header|Haskell}}==
 
<lang Haskell>moduleimport DoubleEvenMagicData.List where(transpose)
import Data.List (transpose)
magicSquare :: Int -> [[Int]]
Line 315 ⟶ 313:
magicSeries :: Int -> [Bool]
magicSeries n
| n <= 10 = [True, False]
| otherwise = xs ++ (not <$> xs)
where
Line 342 ⟶ 340:
where
square = magicSquare n
sums@h:t = sum <$> (square) ++ -- rows
(transpose square) ++ -- cols
(diagonals square) -- diagonals
9,659

edits