Baklava in Awk

Published on 06 April 2025 (Updated: 16 April 2025)

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

Current Solution

function repeat_string(n, s,  result, k) {
    result = ""
    for (k = 1; k <= n; k++) {
        result = result s
    }

    return result
}

BEGIN {
    for (i = -10; i <= 10; i++) {
        num_spaces = (i >= 0) ? i : -i
        num_stars = 21 - 2 * num_spaces
        print repeat_string(num_spaces, " ") repeat_string(num_stars, "*")
    }
}

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