From: Tammo Freese Date: 2001-07-19T21:11:33+09:00 Subject: [ruby-talk:18113] Re: 99 bottles of beer At 17:40 19.07.01 +0900, Steven Grady wrote: >(I believe in Perl circles this is called Golf. This is the first >thread I've seen of Ruby Golf..) > >174 bytes: > >def b(n) "#{n>0?n: 'No more'} bottle#{n!=1?'s': ''} of beer";end >99.downto(1){|n|w=" on the wall";puts "#{b(n)}#{w}, #{b(n)}\nTake one down, pass > it around\n#{b(n-1)}#{w}."} > 164 bytes :-): b=proc{|n|"#{n<1?'No more':n} bottle#{'s'if n!=1} of beer"} 99.downto(1){|n|w=" on the wall";puts"#{b[n]+w}, #{b[n]}\nTake one down, pass it around\n#{b[n-1]+w}."} - Tammo - Tammo Freese freese@acm.org