ピラミッドを作る
pyramid n i | n == i = [replicate (2 * n - 1) '*'] | otherwise = let p = pyramid n (i + 1) in (f (reverse (f (head p)))):p where f [] = [] f (x:xs) = if x == ' ' then x:f xs else ' ':xs f n = mapM_ print $ pyramid n 1
pyramid n i | n == i = [replicate (2 * n - 1) '*'] | otherwise = let p = pyramid n (i + 1) in (f (reverse (f (head p)))):p where f [] = [] f (x:xs) = if x == ' ' then x:f xs else ' ':xs f n = mapM_ print $ pyramid n 1