Created
December 17, 2014 02:48
-
-
Save jdecuirm/99859fea2b2fb5b94b95 to your computer and use it in GitHub Desktop.
ARGV and gets.chomp
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
name, last_name = ARGV | |
print "Now we have your name and last name, can you help us providing your age? " | |
age = gets.chomp | |
print "Thanks, now will be helpful to have your favorite food: " | |
favorite_food = gets.chomp | |
puts "Hi #{name} #{last_name}, we now you are #{age} years old, and you love to eat #{favorite_food}" |
Change gets.chomp to $stdin.gets.chomp on lines 4 and 6
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Change gets.chomp to $stdin.gets.chomp on lines 4 and 6