Skip to content

Commit 66ee035

Browse files
authored
Add Fizz Buzz in Goby (#5202)
1 parent 459a669 commit 66ee035

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

archive/g/goby/fizz-buzz.gb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
i = 1
2+
while i do
3+
if i > 100
4+
break
5+
end
6+
result = ""
7+
if i % 3 == 0
8+
result += "Fizz"
9+
end
10+
if i % 5 == 0
11+
result += "Buzz"
12+
end
13+
if result == ""
14+
result = i.to_s + ""
15+
end
16+
puts(result)
17+
i += 1
18+
end

0 commit comments

Comments
 (0)