Magic squares of singly even order: Difference between revisions
→{{header|Haskell}}: Some top level comments
(→{{header|Haskell}}: Added comments) |
(→{{header|Haskell}}: Some top level comments) |
||
Line 464:
magic :: Int -> [[Int]]
magic n =
let d = (2 * n) + 1 -- LUX table size
startXY = (quot d 2, 0) -- Middle of top row
in threadRows . concat . snd $
mapAccumR -- Numbering of higher-resolution coordinates
(\a (xy, c) -> (a + 4, luxNums xy c a))
1 -- Initial number
(luxPath (luxPattern n) (siamPath (d - 1) [
-- Size required -> square of L U X cells with two mixed rows
|