Skip to content

Create random_menu.rb #29

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 1 commit into
base: master
Choose a base branch
from
Open
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
88 changes: 88 additions & 0 deletions random_menu.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,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",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that you put these on separate lines. It takes up more vertical space but is very readable.

"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!
"