Skip to content

Instantly share code, notes, and snippets.

@amaseda
Created March 17, 2015 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amaseda/b115c6a47603898f1f1d to your computer and use it in GitHub Desktop.
Save amaseda/b115c6a47603898f1f1d to your computer and use it in GitHub Desktop.
W01D02 Homework
puts "C-3P0: C-3P0, human-cyborg relations."
puts "C-3P0: What is your name?"
name = gets.chomp.to_s.capitalize
puts "\nC-3P0: It is a pleasure to meet you, #{name}. Have you ever met a protocol droid before?"
user_answer = gets.chomp.to_s.capitalize
puts "\nC-3P0: #{user_answer}? How interesting, for someone from around these parts."
puts "C-3P0: I'm terribly sorry for prying, but you don't by any chance go by the alias of Obi-Wan Kenobi, do you? (Answer 'I do' or 'I don't')"
know_obi = gets.chomp.to_s.downcase
if know_obi == "i do" || know_obi == "i do."
puts "\nC-3P0: Oh, marvelous! Simply marvelous! Say hello to R2-D2; he's been looking all over for you.\n"
else
puts "\nC-3P0: I've really enjoyed speaking with you, #{name}, but if you'll please excuse me, I have to help my friend find someone named Obi-Wan Kenobi."
puts "Say your favorite farewell to C-3P0: "
farewell = gets.chomp.to_s.capitalize
puts "\nC-3P0: #{farewell} to you too."
puts "C-3P0: Well R2, I suppose we'll just have to keep looking."
puts "R2-D2: (Agreeable droid noises)"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment