Skip to content

Instantly share code, notes, and snippets.

Created July 2, 2015 22:35
Show Gist options
  • Save anonymous/b5546d6c08bfd1dd20f8 to your computer and use it in GitHub Desktop.
Save anonymous/b5546d6c08bfd1dd20f8 to your computer and use it in GitHub Desktop.
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