Skip to content

Instantly share code, notes, and snippets.

@sheland
Last active August 6, 2018 23:28
Show Gist options
  • Select an option

  • Save sheland/7b7c5acba88cbcec76b963236436c9e3 to your computer and use it in GitHub Desktop.

Select an option

Save sheland/7b7c5acba88cbcec76b963236436c9e3 to your computer and use it in GitHub Desktop.
# Day 1
# Create a program that runs from the Terminal that will create a random menu
# based on several items that you determine
#arrays
adjectives = ["hot", "cold", "warm", "freezing","sizzling", "lukewarm",
"boiling", "blazing", "red", "flaming"]
cooking_style = ["steamed", "boiled", "sautéed", "barbecued", "braised", "charbroiled",
"cured", "dry-roasted", "fried", "glazed"]
foods = ["potatoes", "salad", "lasagna", "pizza", "chicken", "lobsters", "pad-thai", "eggplant",
"eggs", "soup"]
result_a = []
1.times { result_a << adjectives.slice!( rand(adjectives.size) ) }
result_c = []
1.times { result_c << cooking_style.slice!( rand(cooking_style.size) ) }
result_f = []
1.times { result_f << foods.slice!( rand(foods.size) ) }
random_food_item = result_a + result_c + result_f
(1...2).each do
puts random_food_item
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment