ya the books and I aren’t quite there yet, put it wont be
long with this ml helping.
Thanks
···
----- Original Message ----
From: Phrogz <gavin@refinery.com>
To: ruby-talk ML <ruby-talk@ruby-lang.org>
Sent: Tuesday, November 7, 2006 12:15:13 PM
Subject: Re: 99 bottles of beer...pg57
On 11/7/06, jamison edmonds <jamison2000e@yahoo.com> wrote:
Any thoughts would be appreciated
Instead of using a 'while' loop (unless that's what the book is
teaching you) I think the following is more Ruby-esque:
99.downto( 1 ) do |num|
puts "#{num} bottles of beer on the wall, #{num} bottles of beer,"
puts "take one down, pass it around,"
end
puts '0,Bottles of beer on the wall ;)'
Note the use of string interpolation also instead of .to_s and +