Skip to content

Instantly share code, notes, and snippets.

@EliseFitz15
Last active August 29, 2015 14:17
Show Gist options
  • Save EliseFitz15/99c341fb8e784aa394c4 to your computer and use it in GitHub Desktop.
Save EliseFitz15/99c341fb8e784aa394c4 to your computer and use it in GitHub Desktop.
Deaf Grandma
# Deaf Grandma
puts "What did you say?" # Grandma asks
bye = 0
while bye < 1
you = gets.chomp
if you != you.upcase
puts "HUH?! SPEAK UP SONNY!"
elsif you == "BYE"
bye += 1
puts "ok bye"
else
puts "No, Not since " + rand(1930..1950).to_s + ", Remember that?"
end
end
#Extended
puts "What did you say?" # Grandma asks
byeCounter = 0
while byeCounter < 3
you = gets.chomp
if you == "BYE!"
byeCounter += 1
if byeCounter <= 2
puts "Oh hi, yes hello"
else
puts "Oh, ok buh-bye sonny"
end
elsif you == you.upcase
puts "No, Not since " + rand(1930..1950).to_s + ", Remember that?"
byeCounter = 0
else
puts "HUH?! SPEAK UP SONNY!"
byeCounter = 0
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment