From: Anna Fedorova Date: 2013-02-09T03:25:37+09:00 Subject: Re: Deaf Grandma For the full iteration of the problem (upcase, random years & triple BYE in a row requests), I've got a slightly simpler structure, the code makes sense to me structurally & intuitively: puts 'Hello there, Sonny. It\'s your grandma!' reply = gets.chomp while reply != 'BYE' if reply == reply.upcase puts 'NO, NOT SINCE ' +(rand(21)+1930).to_s+ '!' reply = gets.chomp else puts 'HUH?! SPEAK UP, SONNY!' reply = gets.chomp end if reply == 'BYE' puts 'CAN\'T HEAR YOU, DEAR!' reply = gets.chomp if reply == 'BYE' puts 'STILL CAN\'T HEAR YOU, DEAR!' reply = gets.chomp if reply == 'BYE' end end end -- Posted via http://www.ruby-forum.com/.