Magic squares of odd order: Difference between revisions
m
→Haskell Transpose . cycled
m (J: interesting alternate approach) |
|||
Line 1,741:
| otherwise = []
--
main :: IO ()
main = mapM_ putStrLn $
--
applyN :: Int -> (a -> a) -> a -> a
applyN n f = foldr (.) id (replicate n f)
Line 1,770:
showSquare rows =
let srows = fmap show <$> rows
w =
in unlines $
{{Out}}
<pre> 8 1 6
|