Advertisement
CrayZeeHit

Untitled

Nov 26th, 2023
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. christmasTree perm i = do
  2.     if perm - 1 == i
  3.         then return()
  4.     else do
  5.         putStrLn (replicate (i - perm) ' ' ++ replicate perm '*' ++ "|" ++ replicate perm '*' ++ replicate (i - perm) ' ')
  6.         christmasTree (perm + 1) i
  7.  
  8. main = do
  9.     n <- getLine
  10.     let i = read n :: Int
  11.     christmasTree 0 i
  12.  
  13. repeatString str i =
  14.     if i == 1
  15.         then str
  16.     else str ++ (repeatString str (i - 1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement