-
-
Save samkahchiin/e63234961da7562b84bf to your computer and use it in GitHub Desktop.
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
# 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