Skip to content

Instantly share code, notes, and snippets.

@lordhumunguz
Created March 12, 2013 05:44
Show Gist options
  • Save lordhumunguz/5140618 to your computer and use it in GitHub Desktop.
Save lordhumunguz/5140618 to your computer and use it in GitHub Desktop.
This gist has been created from CodeCred.me
def bottle_song_recursive(n)
if n==1
puts "1 bottle of beer on the wall, 1 bottle of beer. Take one down, pass it around, no more bottles of beer on the wall!"
else
puts "#{n} bottles of beer on the wall, #{n} bottles of beer. Take one down, pass it around, #{n-1} bottles of beer on the wall!"
n -= 1
bottle_song_recursive(n) unless n == 0
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment