From 8a78d53a6f73b411a1649200537e38e0576a8b0c Mon Sep 17 00:00:00 2001 From: sarafrandsen Date: Thu, 10 Aug 2017 09:16:23 -0700 Subject: [PATCH 1/2] Create random-menu-generator.rb --- random-menu-generator.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 random-menu-generator.rb diff --git a/random-menu-generator.rb b/random-menu-generator.rb new file mode 100644 index 0000000..9f300d8 --- /dev/null +++ b/random-menu-generator.rb @@ -0,0 +1,16 @@ +origins = ["Washington", "Japanese", "Chinese", "French", "Lebanese", "Cajun", "Mexican", "Thai", "Ethiopian", "Canadian"] +adjectives = ["red-hot", "pickled", "overcooked", "cheesy", "salty", "savory", "spoiled", "fermented", "sour", "charred"] +foods = ["mashed potatoes", "ketchup fried rice", "ice cream", "prawns", "liver and onions", "tripe", "sushi", "pancakes", "birthday cake", "imitation crab"] + +puts "How many items would you like to see from our menu?" +listed_items = gets.chomp.to_i + +until listed_items < 10 + puts "We only have 10 items available." + puts "How many items would you like to see from our menu?" + listed_items = gets.chomp.to_i +end + +listed_items.times do | num | + puts "#{num + 1}. #{origins.shuffle!.pop} #{adjectives.shuffle!.pop} #{foods.shuffle!.pop}" +end From 0e2018705644fe6f56680e4909b26a5cfca3e69c Mon Sep 17 00:00:00 2001 From: sarafrandsen Date: Thu, 10 Aug 2017 09:19:17 -0700 Subject: [PATCH 2/2] Update random-menu-generator.rb --- random-menu-generator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/random-menu-generator.rb b/random-menu-generator.rb index 9f300d8..9c070fd 100644 --- a/random-menu-generator.rb +++ b/random-menu-generator.rb @@ -5,7 +5,7 @@ puts "How many items would you like to see from our menu?" listed_items = gets.chomp.to_i -until listed_items < 10 +until listed_items <= 10 puts "We only have 10 items available." puts "How many items would you like to see from our menu?" listed_items = gets.chomp.to_i