Skip to content

Instantly share code, notes, and snippets.

@racbarn
Created April 18, 2011 23:19
Show Gist options
  • Save racbarn/926499 to your computer and use it in GitHub Desktop.
Save racbarn/926499 to your computer and use it in GitHub Desktop.
final 99 beers
beer = 5
while beer > 0
# Repeat what's in here as long as it's TRUE that the counter is greater than zero
puts "#{beer} bottles of beer on the wall, #{beer} bottles of beer! Take one down and pass it around,"
beer = beer - 1
puts "#{beer} bottles of beer on the wall."
end
puts 'There are no bottles of beer on the wall, no bottles of beer, you can\'t take any down or pass \'em around, there are no bottles of beer on the wall.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment