Baklava in Idris

Published on 01 January 2025 (Updated: 01 January 2025)

Welcome to the Baklava in Idris page! Here, you'll find the source code for this program as well as a description of how the program works.

Current Solution

module Main

repeatString : String -> Int -> String
repeatString s n = if n < 1 then "" else s ++ repeatString s (n - 1)

baklavaLine : Int -> String
baklavaLine n = repeatString " " numSpaces ++ repeatString "*" numStars
    where
        numSpaces = abs n
        numStars = 21 - 2 * numSpaces

main : IO ()
main = sequence_ $ map (putStrLn . baklavaLine) [-10..10]

Baklava in Idris was written by:

If you see anything you'd like to change or update, please consider contributing.

How to Implement the Solution

No 'How to Implement the Solution' section available. Please consider contributing.

How to Run the Solution

No 'How to Run the Solution' section available. Please consider contributing.