Skip to content

Pipes Lauren Menu #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions generator_user_input.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# welcome message and user input (choosing amount of menu items)
puts "Welcome to Lauren's Restaurant!"
puts "How many menu items would you like to see? (10 max)"
num = gets.chomp.to_i

puts "Okay, if you'd like to see #{num} menu options, \nyou unfortunately need to come up with those options!"

adj = []
style = []
protein = []
array = [adj, style, protein]

prompts = ["Now, provide #{num} adjectives: ",
"Now, provide #{num} cooking styles: ",
"Please provide #{num} foods: "]

3.times do |i|
puts "#{prompts[i-1]}"
num.times do
array[i] << gets.chomp
end
end

puts "Below is the menu you created!"
adj_sample = array[2].sample(num)
style_sample = array[1].sample(num)
protein_sample = array[0].sample(num)

num.times do |i|
puts "#{i + 1}: #{adj_sample[i]} #{style_sample[i]} #{protein_sample[i]}"
i += 1
end
42 changes: 42 additions & 0 deletions primary_requirements.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Come up with the three arrays of ten items each.
# Each list should be a different type of food
# or descriptor for that food.

adj = %W[smelly creamy sticky stinky slimy strong stringy gooey pungent watery]
style = ["deep-fried", "steamed", "baked", "boiled", "caramelized", "charbroiled", "grilled", "marinated", "microwaved", "pan fried"]
protein = %W[steak chicken tacos kabobs beans tofu pork sandwiches bacon turkey]

puts "Welcome to Lauren's Restaurant!"
puts "How many menu items would you like to see? (10 max)"
num = gets.chomp.to_i

# to avoid duplicates, create a NEW array from OG array!
adj_arr = adj.shuffle
style_arr = style.shuffle
protein_arr = protein.shuffle

# output message
# randomly pulls one item from each array
puts "\nBelow are your menu options:"
num.times do |i|
puts "#{i + 1}: #{adj_arr[i]} #{style_arr[i]} #{protein_arr[i]}"
i += 1
end

# ------ other things I tried:

# First try:
# this works to meet primary requirements
# puts "\nBelow are your menu options:"
# 10.times do |i|
# puts "#{i}: #{adj.sample} #{style.sample} #{protein.sample}"
# i += 1
# end

# long winded way of eliminating duplicates
# for each (adj, style, and protein)
# adj_arr = []
# until adj_arr.length == num do
# rand = adj.sample
# adj_arr.push(rand) unless adj_arr.include?(rand)
# end