From: jamison edmonds Date: 2006-11-08T02:55:44+09:00 Subject: Re: 99 bottles of beer...pg57 --0-757208909-1162922141=:3381 Content-Type: text/plain; charset=ascii Content-Transfer-Encoding: quoted-printable Nice =0AThanks=0A=0A----- Original Message ----=0AFrom: Shiloh Madsen =0ATo: ruby-talk ML =0ASent: T= uesday, November 7, 2006 11:50:35 AM=0ASubject: Re: 99 bottles of beer...pg= 57=0A=0AHi Jamison, I came up with a shorter version. I think it is more=0A= efficient, but I am about as new as you are. Here was my code:=0A=0Abottles= =3D 99=0Awhile bottles > 0=0A puts bottles.to_s + " bottles of beer on = the wall, " + bottles.to_s +=0A" bottles of beer. Take one down and pas= s it around, " + (bottles=0A=3D bottles - 1).to_s + " bottles of beer."=0Ae= nd=0A=0AOn 11/7/06, jamison edmonds wrote:=0A> Hi= =0A>=0A>=0A>=0A> I'm reading the book Learn to Program, by Chris Pine. I=0A= > wanted to see if my program 99 bottles of beer on the wall, from (pg.57 o= r http://pine.fm/LearnToProgram/?Chapter=3D06 ) is=0A> o.k.?=0A>=0A>=0A> An= online search thru Google found Ruby-Talk, and I=0A> instantly bookmarked = it.=0A>=0A>=0A> Now I'm on the list.=0A>=0A>=0A> Any thoughts would be appr= eciated ;)=0A>=0A>=0A> Hears my try at it=0A>=0A>=0A> Thanks=0A>=0A>=0A> pu= ts=0A> puts '99, Bottles of beer on the wall, 99 bottles of beer,'=0A> puts= 'take one down, pass it around,'=0A> first =3D 99=0A> while first !=3D 1= =0A> if first !=3D 1=0A> first =3D first -1=0A> end=0A> put= s first.to_s + ' Bottles of beer on the wall, ' + first.to_s + ' bottles of= beer,'=0A> puts 'take one down pass it around,'=0A> end=0A> puts '0,Bott= les of beer on the wall ;)'=0A>=0A>=0A>=0A>=0A=0A=0A=0A=0A=0A=0A=0A --0-757208909-1162922141=:3381--