Skip to content

Instantly share code, notes, and snippets.

@paulgrever
Last active August 29, 2015 14:11
Show Gist options
  • Save paulgrever/a9ac0da57edf5923315e to your computer and use it in GitHub Desktop.
Save paulgrever/a9ac0da57edf5923315e to your computer and use it in GitHub Desktop.
Paul - 99 Bottles
bottle_of_beer = 99
bottle_start = bottle_of_beer
while bottle_of_beer > 0 do
if bottle_of_beer > 2
puts "#{bottle_of_beer} bottles of beer on the wall, #{bottle_of_beer} bottles of beer."
puts "Take one down and pass it around, #{bottle_of_beer -1} bottles of beer on the wall."
elsif bottle_of_beer == 2
puts "#{bottle_of_beer} bottles of beer on the wall, #{bottle_of_beer} bottles of beer."
puts "Take one down and pass it around, #{bottle_of_beer -1} bottle of beer on the wall."
else
puts "#{bottle_of_beer} bottle of beer on the wall, #{bottle_of_beer} bottle of beer."
puts "Take one down and pass it around, no more bottles of beer on the wall."
puts "No more #{bottles_wall}, no more bottles of beer."
puts "Go to the store and buy some more, #{bottle_start} #{bottles_wall}."
end
bottle_of_beer -= 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment