From: Eleanor McHugh Date: 2008-05-29T02:40:09+09:00 Subject: Re: Learn to Program, by Chris Pine On 28 May 2008, at 18:05, Patrick Hummer wrote: > bottles = 99 > bword = ' bottles' > while bottles != 0 > puts(bottles.to_s + bword + " of beer on the wall!") > puts(bottles.to_s + bword + " of beer!") > puts("Take one down and pass it around!") > bottles = bottles - 1 > puts(bottles.to_s + bword + " of beer on the wall!") > puts '' > if bottles == 1 > bword = ' bottle' > else > bword = ' bottles' > end > end You need to reorder your logic slightly so that bword is changed as soon as the bottle count is decremented: bottle = 99 bword = 'bottles' while bottles != 0 puts(bottles.to_s + bword + " of beer on the wall!") puts(bottles.to_s + bword + " of beer!") puts("Take one down and pass it around!") bottles = bottles - 1 if bottles == 1 bword = ' bottle' else bword = ' bottles' end puts(bottles.to_s + bword + " of beer on the wall!") puts '' end Ellie Eleanor McHugh Games With Brains http://slides.games-with-brains.net ---- raise ArgumentError unless @reality.responds_to? :reason