From cd91fb16b167b43ec7159a5dd039443ca85b3f5c Mon Sep 17 00:00:00 2001 From: kimpossible1 Date: Thu, 10 Aug 2017 09:16:25 -0700 Subject: [PATCH 1/3] Create random_menu_with_optionals --- random_menu_with_optionals | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 random_menu_with_optionals diff --git a/random_menu_with_optionals b/random_menu_with_optionals new file mode 100644 index 0000000..8ac3228 --- /dev/null +++ b/random_menu_with_optionals @@ -0,0 +1,33 @@ +puts "Welcome to the Random Menu Creator!" +puts "How many menu items would you like to generate?" +num_items = gets.chomp.to_i + +until num_items > 0 + puts "That is not a valid number. Please enter the number of menu items." + num_items = gets.chomp.to_i +end + +puts "Thank you! Let's get started!" + +food = Array.new +adjectives = ["hot", "chilled", "sweet", "creamy", "salted", "spicy", "herb-crusted", "tender", "aged", "tangy"] +cooking_method = ["baked", "roasted", "pan-fried", "steamed", "boiled", "toasted", "smoked", "chopped", "grilled", "braised"] + +until food.length == num_items +puts "Please enter one food item you have to offer (ex: chicken, root vegetables, squash...)." +food << gets.chomp.upcase +end + +n = 0 +i = 0 + +adjectives.shuffle! +cooking_method.shuffle! +food.shuffle! + +puts "Here is your random Menu, Bon Appetit! :)" +num_items.times do + n += 1 + puts "#{n}. #{adjectives[i].upcase} #{cooking_method[i].upcase} #{food[i]}" +i += 1 +end From 48a49c94ff128582b85138738147c03d7535e424 Mon Sep 17 00:00:00 2001 From: kimpossible1 Date: Thu, 10 Aug 2017 09:17:27 -0700 Subject: [PATCH 2/3] Create random_menu_basic.rb --- random_menu_basic.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 random_menu_basic.rb diff --git a/random_menu_basic.rb b/random_menu_basic.rb new file mode 100644 index 0000000..2e3a917 --- /dev/null +++ b/random_menu_basic.rb @@ -0,0 +1,14 @@ + +adjectives = ["hot", "chilled", "sweet", "creamy", "salted", "spicy", "herb-crusted", "tender", "aged", "tangy"] +cooking_method = ["baked", "roasted", "pan-fried", "steamed", "boiled", "toasted", "smoked", "chopped", "grilled", "braised"] +food = ["free range chicken", "grass fed beef filet", "clams", "mussels", "salmon", "beets", "brussel sprouts", "root vegetable medley", "kale", "potatos"] + +n = 0 + +10.times do + n += 1 + x = rand(0...10) + y = rand(0...10) + z = rand(0...10) + puts "#{n}. #{adjectives[x].capitalize} #{cooking_method[y].capitalize} #{food[z].capitalize}" +end From 7d9b1cfd9d001a015b1a27929c287995db632bef Mon Sep 17 00:00:00 2001 From: kimpossible1 Date: Thu, 10 Aug 2017 09:18:02 -0700 Subject: [PATCH 3/3] Rename random_menu_with_optionals to random_menu_with_optionals.rb --- random_menu_with_optionals => random_menu_with_optionals.rb | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename random_menu_with_optionals => random_menu_with_optionals.rb (100%) diff --git a/random_menu_with_optionals b/random_menu_with_optionals.rb similarity index 100% rename from random_menu_with_optionals rename to random_menu_with_optionals.rb