Skip to content

Instantly share code, notes, and snippets.

@scottchiang
Created October 2, 2012 04:57
Show Gist options
  • Select an option

  • Save scottchiang/3816245 to your computer and use it in GitHub Desktop.

Select an option

Save scottchiang/3816245 to your computer and use it in GitHub Desktop.
99 bottles
def ninety_nine_bottles(num)
while num>=0
if num == 0
puts "No more bottles of beer on the wall :/"
break
else
puts "#{num} bottles of beer on the wall"
puts "#{num} bottles of beer"
puts "Take one down, pass it around"
puts "#{num-1} bottles of beer on the wall"
num -= 1
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment