Last active
December 31, 2015 16:39
-
-
Save mikeadeleke/8014624 to your computer and use it in GitHub Desktop.
99 bottles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def bottle_song(i) | |
while i > 2 | |
puts "#{i} bottles of beer on the wall, #{i} bottles of beer. " | |
puts "Take one down, pass it around, #{i - 1} bottles of beer on the wall!" | |
i = i - 1 | |
end | |
puts "2 bottles of beer on the wall, 2 bottles of beer." | |
puts "Take one down, pass it around. 1 bottle of beer on the wall!" | |
puts "1 bottle of beer on the wall, 1 bottle of beer." | |
puts "Take one down, pass it around. No more bottles of beer on the wall!" | |
end | |
bottle_song(99) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great!