Created
December 30, 2014 15:27
-
-
Save MichaelSwartz/fe7ac413bfb90df0466e 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
puts "Say hello to your grandmother." | |
bye_counter = 0 | |
while bye_counter < 3 | |
input = gets.chomp | |
if ((input != input.upcase) && (input != "BYE")) | |
puts "HUH?! SPEAK UP, SONNY!" | |
bye_counter = 0 | |
elsif input == "BYE" | |
puts "WHAT?!" | |
bye_counter += 1 | |
else | |
puts "NO, NOT SINCE #{rand(21) + 1930}!" | |
bye_counter = 0 | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment