From: hank johnson Date: 2013-01-12T13:15:52+09:00 Subject: Re: Deaf Grandma - I think it's easy Hieu Le wrote in post #1088624: > puts 'Hi! My name Deaf Grandma' > check = 0 > while check <3 > if (input = gets.chomp) == input.upcase > puts "NO! NOT SINCE " + (1930+rand(21)).to_s + "!" > if input == 'BYE' > check = check + 1 > else > check = 0 > end > > else > puts 'HUH?! SPEAK UP, SONNY!' > end > end > puts 'Goodbye! See you later!' I like this one, but you forgot to reset this check to zero, otherwise it will end the program if the user inputs 'BYE' 3x non-sequentially (i.e 'BYE', 'bye', 'BYE, 'BYE') else puts 'HUH?! SPEAK UP, SONNY!' check = 0 #need this extra reset to zero -- Posted via http://www.ruby-forum.com/.