Skip to content

Instantly share code, notes, and snippets.

@loriculberson
Last active August 29, 2015 14:11
Show Gist options
  • Select an option

  • Save loriculberson/81cc60235426446d286d to your computer and use it in GitHub Desktop.

Select an option

Save loriculberson/81cc60235426446d286d to your computer and use it in GitHub Desktop.
bottles = 99
until bottles < 0
if bottles > 2
puts "#{bottles} bottles of beer on the wall, #{bottles} bottles of beer.\nTake one down, pass it around, #{bottles-1} bottles of beer on the wall."
elsif bottles == 2
puts "#{bottles} bottles of beer on the wall, #{bottles} bottles of beer.\nTake one down, pass it around, #{bottles-1} bottle of beer on the wall."
elsif bottles == 1
puts "#{bottles} bottle of beer on the wall, #{bottles} bottle of beer.\nTake one down, pass it around, #{bottles-1} bottles of beer on the wall."
else bottles == 0
puts "No more bottles of beer on the wall, no more bottles of beer.\nGo to the store, buy some more, 99 bottles of beer on the wall."
end
bottles -= 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment