Dave Thomas <Dave / PragmaticProgrammer.com> writes: > def NIL.n=(n) @n = n; end > def NIL.to_s() %[#@n bottle#{@n == 1 ? "" : "s"} of beer]; end > > 99.downto(1) { |NIL.n| > print "#{NIL} on the wall, #{NIL}.\n" > puts "Take one down, pass it around," > } > puts "No more bottles of beer on the wall." or how about the functional version: 100((1..98).collect { |i| [100-i, "s"]} + [ [1,""], ["There'll be no", "s"]]). collect {|i,s| "#{i} bottle#{s} of beer"}. each { |s| print "#{s} on the wall" print ", #{s}\nTake one down, pass it around" unless s[0] == ?T puts }