SonOfLilit
4/9/2007 3:56:00 PM
You never decrement beerno.
On 4/9/07, Merrie <merries@comcast.net> wrote:
> This program produces an infinate loop. I am learning from Learn to Program and do not have a clear example how to do this particular example. It is suppose to count down the bottles and repeat the phrase until it reach 0 bottles of beer then end :)
>
> Merrie
> -------------------------------------------------------------------------------------
>
> beers = 99
> beerno = beers - 1.to_i
> while beerno != 1
> puts '99 bottles of beer on the wall, take one down, pass it
> around, there are ' + beerno.to_s + 'bottles of beer on the wall.'
>
> end