Skip to content

Instantly share code, notes, and snippets.

@samkahchiin
Forked from nextacademy-private/deaf_aunty.rb
Last active March 15, 2016 11:59
Show Gist options
  • Save samkahchiin/e63234961da7562b84bf to your computer and use it in GitHub Desktop.
Save samkahchiin/e63234961da7562b84bf 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 "HELLO SANDRA!"
user_input=gets.chomp
while user_input != "I love ya, aunty, but I've got to go."
if user_input == user_input.upcase && user_input != ""
puts "NO, WE CAN'T DO THAT!"
user_input = gets.chomp
elsif user_input == ""
user_input = gets.chomp
if user_input == ""
puts "Goodbye!"
break
end
else
puts "HUH?!SPEAK UP,SANDRA"
user_input = gets.chomp
end
if user_input == "I love ya, aunty, but I've got to go."
puts "Goodbye!"
break
end
end
end
# Run our method
deaf_aunty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment