A Collection of Code Snippets in as Many Programming Languages as Possible
This project is maintained by TheRenegadeCoder
Welcome to the Baklava in Eta page! Here, you'll find the source code for this program as well as a description of how the program works.
module Main where
baklavaLine :: Int -> String
baklavaLine n = (replicate numSpaces ' ') ++ (replicate numStars '*') ++ "\n"
where
numSpaces = abs(n - 10)
numStars = 21 - 2 * numSpaces
baklava :: String -> Int -> String
baklava s 0 = s ++ baklavaLine 0
baklava s n = s ++ baklavaLine n ++ baklava s (n - 1)
main :: IO ()
main = putStr (baklava "" 20)
Baklava in Eta was written by:
If you see anything you'd like to change or update, please consider contributing.
No 'How to Implement the Solution' section available. Please consider contributing.
No 'How to Run the Solution' section available. Please consider contributing.