forked from Ada-C7/Random-Menu
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrandom_menu.rb
More file actions
54 lines (50 loc) · 1.07 KB
/
random_menu.rb
File metadata and controls
54 lines (50 loc) · 1.07 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Declare menu items
array_adjective = [ "Hot",
"Cold",
"Spicy",
"Soft",
"Hard",
"Salty",
"Sweet",
"Creamy",
"Crunchy",
"Milky"
]
array_style = [ "Steamed",
"Pan-fried",
"Sauteed",
"Sezchuan",
"Curried",
"Teriyaki",
"Tandoori",
"Chopped",
"Seasoned",
"Roasted"
]
array_food = [ "Tofu",
"Seitan",
"Potatoes",
"Bread",
"Beans",
"Rice",
"Eggplant",
"Mushroom",
"Noodles",
"Peppers"
]
# Request and receive user input for number of items
print "Welcome to Sahana's Crazy Menu!\nHow many items would you like to peruse? We have 10 items. "
user_input = gets.to_i
# Verify user input
# Generate random Menu
# Delete items from arrays so they cannot be used again
if user_input <= 10
user_input.times { |n|
puts "#{ n + 1 }. #{adjective = array_adjective.sample} #{style = array_style.sample} #{food = array_food.sample}"
array_adjective = array_adjective - [adjective]
array_style = array_style - [style]
array_food = array_food - [food]
}
else
puts "Sorry, we don't have that many items. Please choose between 1-10."
end