forked from Ada-C9/Random-Menu
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.rb
More file actions
39 lines (28 loc) · 1.06 KB
/
menu.rb
File metadata and controls
39 lines (28 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#Arrays of descriptors/food, could have user input them and push into Arrays
adjective_one = ["smelly", "noisey", "hot", "cold", "freezing", "tepid",
"squishy", "pungent", "fuzzy", "crazy"]
adjective_two = ["smoked", "boiled", "crunchy", "sweet", "soft", "raw",
"okay", "weird", "normal", "sharp"]
actual_food = ["salmon", "turnips", "sprouts", "steak", "sushi", "cauliflower",
"cheese", "dumplings", "kale", "meatballs"]
# Get user input for menu length
puts "How many menu items would you like to choose from?"
menu_items = gets.chomp.to_i
# Make sure menu length is between 1 and 10
until menu_items <= 10 && menu_items > 0
puts "Please enter a number between 1 and 10."
menu_items = gets.chomp.to_i
end
# Prints menu from menu length and arrays
puts "Here's what's on the menu today: "
num = 0
menu_items.times do
num += 1
adj_one = adjective_one.sample
adj_two = adjective_two.sample
food = actual_food.sample
puts "#{num}. #{adj_one}, #{adj_two}, #{food}"
adjective_one.delete(adj_one)
adjective_two.delete(adj_two)
actual_food.delete(food)
end