Created
May 26, 2015 14:49
-
-
Save adamcaron/3f0ef66df6c7cfee04c5 to your computer and use it in GitHub Desktop.
99 Bottles of Beer on the Wall
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
# Write a program that "sings" the classic, | |
# "99 Bottles of Beer on the Wall". | |
# start at 100 and use the .downto enumerator | |
for i in (100).downto(0) | |
if i > 1 | |
puts "#{i} Bottles of Beer on the Wall, | |
#{i} Bottles of Beer... take one down, pass it around," | |
elsif i == 1 | |
puts "#{i} Bottle of Beer on the Wall, | |
#{i} Bottle of Beer... take one down, pass it around," | |
else | |
puts "Go drunk, you're home." | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment