Skip to content

Instantly share code, notes, and snippets.

@dpickett
Created February 27, 2014 01:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpickett/b31b0104893f6e2b5e63 to your computer and use it in GitHub Desktop.
Save dpickett/b31b0104893f6e2b5e63 to your computer and use it in GitHub Desktop.
MEATS = [
'steak',
'roast beef'
]
FRUITS = [
'apple',
'orange',
'grapes'
]
VEGETABLES = [
'carrots',
'corn',
'squash'
]
puts "What's for dinner?"
food = gets.chomp
if MEATS.include?(food)
puts "it's a meat"
elsif FRUITS.include?(food)
puts "it's a fruit"
elsif VEGETABLES.include?(food)
puts "it's a vegetable"
else
puts "We couldn't identify the food"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment