Skip to content

Instantly share code, notes, and snippets.

@joshmun23
Last active August 29, 2015 14:10
Show Gist options
  • Save joshmun23/6a727fca8042c6c161de to your computer and use it in GitHub Desktop.
Save joshmun23/6a727fca8042c6c161de to your computer and use it in GitHub Desktop.
Deaf Grandma
class String
def upcase?
self == self.upcase
end
end
puts "HI THERE, SONNY!!"
while true
reply = gets.chomp
break if reply == 'BYE'
lowercase_response = "HUH?! SPEAK UP, SONNY!"
uppercase_response = "NO, NOT SINCE #{rand(1930..1950)}"
puts response = reply.upcase? ? uppercase_response : lowercase_response
end
class String
def upcase?
self == self.upcase
end
end
puts "HI THERE, SONNY!!"
bye_counter = 0
while bye_counter < 3
reply = gets.chomp
bye_counter = reply == 'BYE' ? bye_counter + 1 : 0
lowercase_response = "HUH?! SPEAK UP, SONNY!"
uppercase_response = "NO, NOT SINCE #{rand(1930..1950)}"
unless reply == 'BYE'
puts response = reply.upcase? ? uppercase_response : lowercase_response
end
end
puts "Fine.. I'll just go play bingo with the girls.."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment