Last active
August 29, 2015 14:17
-
-
Save EliseFitz15/99c341fb8e784aa394c4 to your computer and use it in GitHub Desktop.
Deaf Grandma
This file contains hidden or 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
# 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