From 4c89f46577689cbb041d364f105b3ed5e1ed3688 Mon Sep 17 00:00:00 2001 From: sairagula Date: Thu, 10 Aug 2017 09:16:37 -0700 Subject: [PATCH 1/2] Create random_menu_optional.rb --- random_menu_optional.rb | 45 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 random_menu_optional.rb diff --git a/random_menu_optional.rb b/random_menu_optional.rb new file mode 100644 index 0000000..4b6cdfd --- /dev/null +++ b/random_menu_optional.rb @@ -0,0 +1,45 @@ +adjectives = [] +cooking_style = [] +food = [] +new_adj = [] +new_cooking_style = [] +new_food = [] + + +puts "Please enter how many items would you like to enter: " +count = gets.chomp.to_i + +count.times do + puts "Please enter your adjective: " + user_adj = gets.chomp + adjectives.push(user_adj) + + puts"How would you like the food to be cooked? " + user_cooking = gets.chomp + cooking_style.push(user_cooking) + puts "What food do you want?" + user_food = gets.chomp + food.push(user_food) +end +new_adj = [] +new_cooking_style = [] +new_food = [] +puts "how many menu items would you like to see? " +count2 = gets.chomp.to_i +while count2 > count or count2 < 1 + print "Enter positive number smaller than #{count} :" + count2 = gets.chomp.to_i +end +puts "Menu of the Day : " +i = 0 +while i < count2 do + a = adjectives.sample(1)[0] + adjectives.delete(a) + b = cooking_style.sample(1)[0] + cooking_style.delete(b) + c = food.sample(1)[0] + food.delete(c) + i += 1 +puts "#{i}. #{a} #{b} #{c}\n " + +end From 5c8a4fc1b4097e6a809e2d7df3db5820dc6dd347 Mon Sep 17 00:00:00 2001 From: sairagula Date: Thu, 10 Aug 2017 09:19:23 -0700 Subject: [PATCH 2/2] Create random_menu.rb --- random_menu.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 random_menu.rb diff --git a/random_menu.rb b/random_menu.rb new file mode 100644 index 0000000..7c8ea84 --- /dev/null +++ b/random_menu.rb @@ -0,0 +1,19 @@ +adjectives = ["hot", "warm", "cold", "creamy", "juicy", "tender", "soft", "hard", "sweet", "spicy"] +cooking_style = ["seared", "baked", "fried", "boiled", "steamed", "sauteed", "seasoned", "fresh", "grilled", "half-cooked" ] +food = ["chicken", "beef", "cake", "turkey", "veggie", "lamb", "mushroom", "salmon", "clam", "casserole"] + +new_adj = [] +new_cooking_style = [] +new_food = [] +puts "Menu of the Day : " +10.times do |i| + a = adjectives.sample(1)[0] + adjectives.delete(a) + b = cooking_style.sample(1)[0] + cooking_style.delete(b) + c = food.sample(1)[0] + food.delete(c) + +puts "#{i+1}. #{a} #{b} #{c}\n " + +end