From: "Xavier NoĆ«lle" Date: 2010-01-23T00:44:58+09:00 Subject: Re: Argh?! :) kEND, $end and kELSE in a simple program 2010/1/22 Jet Koten : > Hi, Hi ! > puts 'Say something to the virtual hard-of-hearing Grandpa:' > while true >  said=gets.chomp >  year = (1930+rand(51)) >  counter=0 >  if said=='GOODBYE' >  counter+=1 >    if counter==3 >      break >    end >  end >  elsif said !=said.upcase You closed your 'if' scope too early, then the 'elsif' became orphan (=> 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 = 0" gets called after your program has determined what you said (=> put it before the loop and that should do the trick ;-)) -- Xavier NOELLE