Skip to content

Instantly share code, notes, and snippets.

@nickliou91
Forked from nextacademy-private/deaf_aunty.rb
Last active August 29, 2015 14:07
Show Gist options
  • Select an option

  • Save nickliou91/b2db7413da2de0cc7cb2 to your computer and use it in GitHub Desktop.

Select an option

Save nickliou91/b2db7413da2de0cc7cb2 to your computer and use it in GitHub Desktop.
# Save this file to your computer so you can run it
# via the command line (Terminal) like so:
# $ ruby deaf_aunty.rb
#
# Your method should wait for user input, which corresponds
# to you saying something to your Aunty.
# You'll probably want to write other methods, but this
# encapsulates the core Aunty logic
def deaf_aunty
puts "Is that you, my grandchild?"
while true
"Sandra:"
user_input=gets.chomp
#user doesnt shout
if user_input =="I love ya, aunty, but I've got to go."
break
else
if user_input ==user_input.downcase
puts "Grandma:SPEAK UP, SANDRA!"
#user shouts
elsif user_input==user_input.upcase
puts "Grandma:NO, WE CAN'T DO THAT!"
end
end
end
end
deaf_aunty()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment