Created
October 10, 2015 10:18
-
-
Save Adsidera/449036cf33a123776a19 to your computer and use it in GitHub Desktop.
Fav.foods.rb
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
def fav_foods | |
food_array = [] | |
3.times do | |
puts "Name a favorite food" | |
food_array<< gets.chomp #shovel operator - takes the user inputs with gets.chomp and makes them elements of the array food_array# | |
end | |
puts "Your favorite foods are #{food_array.join(",")}" | |
food_array.each do |food| | |
puts "I like #{food} too!" | |
end | |
end | |
fav_foods |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment