LJZN

每天更新Rails练习项目到Github~

» Home
» Category
» About Me
» Github

笨方法学Ruby第十四天

26 Jun 2016 » LRTHW
user_name, race = ARGV
prompt = '> '

puts "Hi #{user_name} the #{race}."
puts "I'd like to ask you a few questions."
puts "Do you like me #{user_name}? ", prompt
likes = $stdin.gets.chomp

puts "Where do you live #{user_name}? ", prompt
lives = $stdin.gets.chomp

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.
"""

Related Posts