Skip to content

Instantly share code, notes, and snippets.

@fourseven
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fourseven/9864748 to your computer and use it in GitHub Desktop.
Save fourseven/9864748 to your computer and use it in GitHub Desktop.
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"
@Breccan
Copy link

Breccan commented Mar 29, 2014

"#{i} bottle#{:s if i>1} of beer#{" on the wall" if w}"

@fourseven
Copy link
Author

Thanks @Breccan, updated! :shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment