Skip to content

Instantly share code, notes, and snippets.

@adamcaron
Created May 26, 2015 14:49
Show Gist options
  • Save adamcaron/3f0ef66df6c7cfee04c5 to your computer and use it in GitHub Desktop.
Save adamcaron/3f0ef66df6c7cfee04c5 to your computer and use it in GitHub Desktop.
99 Bottles of Beer on the Wall
# 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