Created
February 15, 2009 08:29
-
-
Save anonymous/64645 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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