1
0
Fork 0
lrthw/exercises/ex14.rb

23 lines
554 B
Ruby
Raw Normal View History

2023-09-30 13:20:59 +00:00
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.
"