Baklava in Orc

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

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

Current Solution

def Baklava(start, end) =
    Ift(start <= end) >>
        Println(BaklavaLine(start)) >>
        Baklava(start + 1, end)

def BaklavaLine(n) = 
    val num_spaces = abs(n)
    val num_stars = 21 - 2 * num_spaces
    RepeatString(" ", num_spaces) + RepeatString("*", num_stars)

def RepeatString(s, n) = if n <: 1 then "" else s + RepeatString(s, n - 1)

Baklava(-10, 10) >>
stop

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