Skip to content

Commit e2f578c

Browse files
authored
Add Fizz Buzz in Eiffel (#4370)
1 parent 06dbe97 commit e2f578c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

archive/e/eiffel/fizz_buzz.e

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
class
2+
fizz_buzz
3+
4+
create
5+
make
6+
7+
feature
8+
make
9+
do
10+
across 1 |..| 100 as i
11+
loop
12+
if i.item \\ 15 = 0 then io.put_string("FizzBuzz")
13+
elseif i.item \\ 5 = 0 then io.put_string("Buzz")
14+
elseif i.item \\ 3 = 0 then io.put_string("Fizz")
15+
else io.put_integer(i.item)
16+
end
17+
18+
io.put_new_line
19+
end
20+
end
21+
end

0 commit comments

Comments
 (0)