2010/1/22 Jet Koten <jetkoten / gmail.com>:
> Hi,

Hi !

> puts 'Say something to the virtual hard-of-hearing Grandpa:'
> while true
> =A0said=3Dgets.chomp
> =A0year =3D (1930+rand(51))
> =A0counter=3D0
> =A0if said=3D=3D'GOODBYE'
> =A0counter+=3D1
> =A0 =A0if counter=3D=3D3
> =A0 =A0 =A0break
> =A0 =A0end
> =A0end
> =A0elsif said !=3Dsaid.upcase

You closed your 'if' scope too early, then the 'elsif' became orphan
(=3D> remove the 'end').

> So basically it's supposed to be that it'll just loop forever unless you
> say GOODBYE three times in a row... and not just three times with
> something else in between.

The problem is that you reset the counter at the beginning of each
loop iteration.
"counter =3D 0" gets called after your program has determined what you
said (=3D> put it before the loop and that should do the trick ;-))

--=20
Xavier NOELLE