Baklava in Pineapple

Published on 20 November 2024 (Updated: 20 November 2024)

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

Current Solution

def (this String).repeat(times Number) -> String
    let i mutable = times
    let s mutable = ""
    while i > 0
        s =  "$(s)$(this)"
        i = i - 1

    return s

def .main
    let i mutable = -10
    while i <= 10
        let numSpaces mutable = i
        if numSpaces < 0
            numSpaces = -numSpaces

        let spaces = " ".repeat(numSpaces)
        let stars = "*".repeat(21 - (2 * numSpaces))
        "$(spaces)$(stars)".show
        i = i + 1

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