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
33 lines (26 loc) · 894 Bytes
/
random_menu.rb
File metadata and controls
33 lines (26 loc) · 894 Bytes
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
food = []
cook = []
adj = []
array = [food, cook, adj]
puts "How many many items would you like to see?"
menu_items = gets.chomp.to_i
until menu_items < 11
puts "Unfortunately we don't have that many items on our menu. Please select a smaller number."
menu_items = gets.chomp.to_i
end
prompts = ["Please list #{menu_items} types of food you like to eat.", "Please list #{menu_items} methods of cooking food that you enjoy eating.", "Please list #{menu_items} fun food adjective."]
puts "Now you can help us build our menu!"
3.times do |i|
puts "#{prompts[i-1]}"
menu_items.times do
array[i] << gets.chomp.to_s
end
end
puts "--"
puts "MENU"
adj_samples = array[0].sample(menu_items)
food_samples = array[1].sample(menu_items)
cooked_samples = array[2].sample(menu_items)
menu_items.times do |i|
puts "#{i+1}. #{adj_samples[i]} #{cooked_samples[i]} #{food_samples[i]}"
end