Created
January 28, 2013 20:52
-
-
Save JustSilverman/4658893 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
def deaf_grandma | |
loop do | |
response = gets.chomp | |
if response == "I love ya, Grandma, but I've got to go." | |
break | |
elsif curse_word_check(response) | |
puts "Make your own Fucking meatloaf" | |
elsif response.upcase == response | |
puts "NO, NOT SINCE 1983!" | |
else | |
puts "HUH?! SPEAK UP, SONNY!" | |
end | |
end | |
end | |
def curse_words | |
['fuck', 'shit'] | |
end | |
def curse_word_check(response) | |
response.split(' ').each do |x| | |
if curse_words.include?(x.downcase) | |
return true | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment