Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- printSpaces :: Int -> IO ()
- printSpaces n = putStr (replicate n ' ')
- printStars :: Int -> IO ()
- printStars n = putStrLn (replicate n '*')
- printMirrorUpperStarTriangle :: Int -> Int -> IO ()
- printMirrorUpperStarTriangle n x
- | x > n = return ()
- | otherwise = do
- printSpaces (n - x)
- printStars (2 * x - 1)
- printMirrorUpperStarTriangle n (x + 1)
- main :: IO ()
- main = do
- putStrLn "wprowadz wysokosc: "
- input <- getLine
- let height = read input :: Int
- printMirrorUpperStarTriangle height 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement