Baklava in Lily

Published on 27 December 2024 (Updated: 27 December 2024)

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

Current Solution

import math

define repeatString(s: String, n: Integer): String
{
    var result = ""
    if n > 0: {
        for i in 1...n: {
            result = "{0}{1}".format(result, s)
        }
    }

    return result
}

for n in -10...10: {
    var num_spaces = math.abs(n)
    var num_stars = 21 - 2 * num_spaces
    print("{0}{1}".format(repeatString(" ", num_spaces), repeatString("*", num_stars)))
}

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