Baklava in Koka

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

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

Current Solution

fun repeat_string(s : string, n : int) {
    var result := ""
    list(1, n).foreach(fn(_) { result := result + s })
    result
}

fun main() {
    list(-10, 10).foreach(fn(n) {
        var num_spaces := abs(n)
        var num_stars := 21 - 2 * num_spaces
        println(repeat_string(" ", num_spaces) + repeat_string("*", num_stars))
    })
}

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