Baklava in Gluon

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

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

Current Solution

let io @ { ? } = import! std.io
let int @ { ? } = import! std.int

rec let repeat_string s n : String -> Int -> String =
    if n > 0 then
        s ++ (repeat_string s (n - 1))
    else
        ""

let baklava_line n : Int -> String =
    let num_spaces = int.abs n
    let num_stars = 21 - 2 * num_spaces
    (repeat_string " " num_spaces) ++ (repeat_string "*" num_stars)

rec let baklava n ne : Int -> Int -> io.IO () =
    if n <= ne then
        io.println (baklava_line n)
        baklava (n + 1) ne
    else
        io.print ""

baklava -10 10

Baklava in Gluon 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.