Baklava in Eiffel

Published on 08 January 2025 (Updated: 08 January 2025)

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

Current Solution

class 
    baklava

create
    make

feature

    make
        local
            num_spaces: INTEGER
            num_stars: INTEGER
        do 
            across
                -10 |..| 10 as n
            loop
                num_spaces := n.item.abs
                num_stars := 21 - 2 * num_spaces
                print (repeat_string(" ", num_spaces) + repeat_string("*", num_stars) + "%N")
            end
        end

    repeat_string(s: STRING; n: INTEGER): STRING
        do
            Result := ""
            across
                1 |..| n as x
            loop
                Result := Result + s
            end
        end
end

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