Created
June 15, 2016 02:30
-
-
Save imcodingideas/6b149d616b8241949a3d9988df9a0db7 to your computer and use it in GitHub Desktop.
Little chatbot learning some of the control flow in ruby.
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
chat_bot = "Ruby" | |
age = 32 | |
city = "Hermosillo" | |
puts "Hello! My name is #{chat_bot}" | |
puts "What is your name?" | |
username = gets.chomp | |
puts "Hi there #{username}, great to meet you! How can I help you today?" | |
question = gets.chomp | |
if question == 'How old are you?' | |
puts "I am #{age} years old" | |
end | |
if question == 'Where do you live?' | |
puts "I live in #{city}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment