Skip to content

Instantly share code, notes, and snippets.

@iamnoobkia
Forked from nextacademy-private/deaf_aunty.rb
Last active April 13, 2016 13:47
Show Gist options
  • Select an option

  • Save iamnoobkia/0cabc080fc0fa166a0b2 to your computer and use it in GitHub Desktop.

Select an option

Save iamnoobkia/0cabc080fc0fa166a0b2 to your computer and use it in GitHub Desktop.
def crazy_aunty
puts "Hi Sandra! Say hi to deaf Aunty :)"
n = 0
while answer = gets.chomp
if answer.empty?
n+=1
break if n==2
elsif answer == "I love ya, Aunty, but I've got to go."
puts "Bye, Sandra!"
break
elsif answer == answer.downcase
puts "HUH?! SPEAK UP, SANDRA"
else answer == answer.upcase
puts "NO! WE CANT DO THAT!"
end
end
end
crazy_aunty
def deaf_aunty
puts "Hi Sandra! Say hi to deaf Aunty :)"
sandra_input = gets.chomp
while sandra_input != "I love you, aunty, but I've got to go."
if sandra_input == sandra_input.upcase
puts "NO, WE CAN'T DO THAT!"
sandra_input = gets.chomp
else sandra_input == sandra_input.downcase
puts "HUH?! SPEAK UP, SANDRA"
sandra_input = gets.chomp
end
end
puts "Bye, Sandra!"
end
deaf_aunty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment