Created
November 10, 2015 19:55
-
-
Save kylekeesling/1a255ebe6505823c5a83 to your computer and use it in GitHub Desktop.
Deaf Grandma
This file contains 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
chatting = true | |
byes = 0 | |
while chatting | |
puts "Ask Grandma a question:" | |
said = gets.chomp! | |
if said == "BYE" | |
byes += 1 | |
if byes > 2 | |
chatting = false | |
else | |
puts "** Grandma is ignoring you **" | |
end | |
elsif said == said.upcase | |
year = 1930 + Random.rand(20) | |
puts "NO, NOT SINCE #{year}!" | |
else | |
puts "HUH?! SPEAK UP, SONNY!" | |
end | |
end | |
puts "Thanks for chatting with Grandma" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment