forked from Ada-C8/Random-Menu
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrandom_menu.rb
More file actions
88 lines (73 loc) · 1.56 KB
/
random_menu.rb
File metadata and controls
88 lines (73 loc) · 1.56 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Create a random menu generator that can be played from the Terminal.
#
# Your generator should pull one item from each array you made in the baseline requirements to create a "menu item".
#
# When the program runs, it should create and show a list of ten numbered menu items.
#
# 1. hot pan-fried dumplings
# 2. soft steamed clams
# 3. ...
# ...
# 10. creamy taco cake
# Test & Verify
#
# Before you submit your work it's important to test your program and ensure it's working properly.
#
# Among your tests ensure that:
#
# The menu items are selected randomly.
# There are 10 menu items numbered 1 - 10 (not starting at zero)
# Each item should pull one word from each of the 3 arrays.
menu_items = 10
food_adjectives = [
"Crunchy",
"Soft",
"Sweet",
"Sour",
"Salty",
"Bitter",
"Umami",
"Fermented",
"Fresh",
"Flavorful"
]
cooking_methods = [
"Steamed",
"Sauteed",
"Fried",
"Deep-fried",
"Poched",
"Raw",
"Blanched",
"Boiled",
"Baked",
"Broiled"
]
food_items = [
"Scallops",
"Salmon",
"Squid",
"Macrel",
"Tuna",
"Chicken",
"Beef",
"Pork",
"Lamb",
"Veal"
]
puts "Welcome to the Random Food Machine! A menu will randomly be created from our three lists.
List 1: Adjectives
List 2: Cooking Method
List 3: Food Item
Menu Item Example: Crunchy Steamed Scallops
Here is your menu!
"
(1..menu_items).each do |x|
list_1_random = food_adjectives.sample
list_2_random = cooking_methods.sample
list_3_random = food_items.sample
puts "#{x}. #{list_1_random} #{list_2_random} #{list_3_random}"
end
puts "
Bon appetit!
"