A Collection of Code Snippets in as Many Programming Languages as Possible
This project is maintained by TheRenegadeCoder
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.
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.
No 'How to Implement the Solution' section available. Please consider contributing.
No 'How to Run the Solution' section available. Please consider contributing.