From: Park Heesob Date: 2003-01-16T11:20:52+09:00 Subject: Re: Ruby advocacy in sigs Hi, "Daniel Carrera" wrote in message news:Pine.GSO.4.44.0301151733000.1625-100000@runge.math.umd.edu... > On Thu, 16 Jan 2003, Gennady wrote: > > > > > > > my favourite: > > > 99.downto 1 do |x| > > > puts "#{x} bottles of beer on the wall", > > > " #{x} bottles of beer!", > > > "Take one down, pass it around," end > > > > > > puts "No more bottles of beer on the wall!" > > > > > > > A small refactoring ;-) -- > > > > 99.downto 1 do |x| > > puts "#{x} #{@b||='bottles of beer'} #{@w||='on the wall'}", > > " #{x} #{@b}!", > > "Take one down, pass it around," end > > puts "No more #{@b} #{@w}!" > > > > Well, the idea is that any reader can understand the code, thus > demonstrating the readability of Ruby. I can't figure out what your code > does, so I doubt a non-rubyist would. > > How about?: > > 99.downto 1 do |x| > puts < #{x} bottles of beer on the wall. > #{x} bottles of beer. > Take one down, pass it around. > EOH > end > How about submit it at http://99-bottles-of-beer.ls-la.net/ ? There are 6 Perl versions, http://99-bottles-of-beer.ls-la.net/p.html#Perl but only 1 Ruby version. http://99-bottles-of-beer.ls-la.net/r.html#Ruby Park Heesob