Created
July 2, 2015 22:35
-
-
Save anonymous/b5546d6c08bfd1dd20f8 to your computer and use it in GitHub Desktop.
This file contains 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
print "Wanted to see if you were here today! yes/no? " | |
def handle_yes | |
puts "sweet! What time is good for you?" | |
time = gets.chomp | |
puts "Right on, I'll see you at #{time}!!" | |
end | |
def handle_no | |
puts "Sad. Next week it is!" | |
end | |
def handle_maybe | |
puts "Maybe, eh? Just let me know when is good for you!" | |
end | |
def handle_quit | |
puts "Goodbye" | |
end | |
while input = gets.chomp.upcase | |
break handle_yes if %w[YES Y].include?(input) | |
break handle_no if %w[N NO].include?(input) | |
break handle_maybe if %w[MAYBE].include?(input) | |
break handle_quit if %w[Q QUIT EXIT].include?(input) | |
puts "That does not compute! Try again: yes/no? " | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment