From 626a112623b93902e9d75df79517ad6945131271 Mon Sep 17 00:00:00 2001 From: sheland Date: Tue, 7 Aug 2018 10:41:07 -0700 Subject: [PATCH] sheland --- random-menu.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 random-menu.rb diff --git a/random-menu.rb b/random-menu.rb new file mode 100644 index 0000000..dd72250 --- /dev/null +++ b/random-menu.rb @@ -0,0 +1,23 @@ +#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) ) } + 1.times { result_f << foods.slice!(rand(foods)} + +random_food_item = result_a + result_c + result_f +(1...2).each do + puts random_food_item +end