Skip to content

Instantly share code, notes, and snippets.

Created February 15, 2009 08:29
Show Gist options
  • Save anonymous/64645 to your computer and use it in GitHub Desktop.
Save anonymous/64645 to your computer and use it in GitHub Desktop.
# Here's the problem: Ruby is playing the part of a deaf grandma. If I
# don't ask her a question in upcase, she can't hear me. If I ask her any
# question in upcase, she'll respond in the same fashion unless I shout BYE
# to her. I need to shout BYE to her 3 times to escape her madness.
puts 'What is it dear?'
question = gets
counter = 0
while counter < 2
while question != question.upcase
puts 'What? Speak up sonny.'
question = gets
end
if question != 'bye'.upcase
puts 'No. Not since 19'+rand(10).to_s+rand(10).to_s
question = gets
else
counter += 1
puts 'What was that dear?'
question = gets
end
end
puts 'Goodbye dear.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment