Commit eda53deb by Đường Sỹ Hoàng

Prompting And Passing

parent c42a52a6
Pipeline #108 canceled with stages
in 0 seconds
user_name = ARGV.first # gets the first argument
prompt = '>'
puts "Hi #{user_name}."
puts "I'd like to ask you a few questions."
puts "Do you like me #{user_name}? "
puts prompt
likes = $stdin.gets.chomp
puts "Where do you live #{user_name}?"
puts prompt
lives= $stdin.gets.chomp
#a comma for puts is like using it twice
puts "What kind of computer do you have?",prompt
computer = $stdin.gets.chomp
puts """
Alright, so you said #{likes} about liking me.
You live in #{lives}. Not sure where that is.
And you have a #{computer} computer. Nice.
"""
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment