Skip to content

Instantly share code, notes, and snippets.

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

  • Save hannahbasil/eb15e4d3683e69cdd553 to your computer and use it in GitHub Desktop.

Select an option

Save hannahbasil/eb15e4d3683e69cdd553 to your computer and use it in GitHub Desktop.
99 bottles of beer
while number.to_i >=1
puts "What's the first number in the 99 bottles of beer on the wall song?"
number= gets.chomp
puts number + " bottles of beer on the wall," + number +" bottles of beer."
puts "Take one down and pass it around,"+((number.to_i)-1).to_s+ " bottles of beer on the wall."
if number.to_i == 1
break
puts "1 bottle of beer on the wall, 1 bottle of beer.
Take one down and pass it around, no more bottles of beer on the wall.
No more bottles of beer on the wall, no more bottles of beer.
Go to the store and buy some more, 99 bottles of beer on the wall."
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment