Last active
August 29, 2015 13:57
-
-
Save fourseven/9864748 to your computer and use it in GitHub Desktop.
Revisions
-
Mathew Hartley revised this gist
Mar 29, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ 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" -
Mathew Hartley created this gist
Mar 29, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ def b i=1,w=nil "#{i} bottle#{i==1 ?'':'s'} of beer#{w ?" on the wall":''}" 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"