Last active
August 29, 2015 13:57
-
-
Save fourseven/9864748 to your computer and use it in GitHub Desktop.
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 b i=1,w=nil | |
"#{i} bottle#{:s if i>1} of beer#{" on the wall" if w}" | |
end | |
puts *99.downto(2).map {|n| "#{b n,1}, #{b n}.\nTake one down and pass it around, #{b n-1,1}.\n\n"} | |
puts "#{b 1,1}, #{b}.\nGo to the store and buy some more, #{b 99,1}.\n\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"#{i} bottle#{:s if i>1} of beer#{" on the wall" if w}"