Skip to content

Commit bd155e1

Browse files
committed
Bottle completed
1 parent 09f0c04 commit bd155e1

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

exercises/bottles.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,21 @@
2727
# etc.
2828

2929
def bottles(start_number)
30+
puts "Counting down..."
31+
start_number.downto(1) do |i|
32+
if i > 1
33+
print "#{i} bottles of beer on the wall, #{i} bottles of beer. Take one down, pass it around, "
34+
puts "#{i-1} bottles of beer on the wall!"
35+
else
36+
print "#{i} bottles of beer on the wall, #{i} bottles of beer. Take one down, pass it around, no more bottles of beer on the wall!"
37+
end
38+
end
39+
#I could not implement the method at the moment so I just coded it logically straight
3040
end
3141

3242
if __FILE__ == $PROGRAM_NAME
3343
# What *should* this print?
34-
bottles(5)
44+
bottles(50)
3545
end
3646

3747
# Hint #1:

0 commit comments

Comments
 (0)