Created
March 12, 2013 05:44
-
-
Save lordhumunguz/5140618 to your computer and use it in GitHub Desktop.
This gist has been created from CodeCred.me
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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