forked from AdaGold/random-menu
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Bianca menu gen #23
Open
biciclista22
wants to merge
1
commit into
Ada-C8:master
Choose a base branch
from
biciclista22:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Bianca menu gen #23
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# 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. | ||
|
||
adjectives = ["hot", "lukewarm", "slimy", "slippery", "savory", "delicious", "sweet", "salty", "chocolatey", "robust"] | ||
cooking_style = ["pan-fried", "fried", "steamed", "baked", "sauteed", "microwaved", "roasted", "barbecued", "raw", "beer-batterd"] | ||
food = ["chicken", "fish", "pork", "zucchini", "broccoli", "squash", "beef", "buffalo burger", "chicken fried steak", "waffles"] | ||
|
||
puts "-" * 15 + "Menu" + "-" * 15 | ||
|
||
10.times do |num| | ||
puts "#{num + 1}. #{adjectives.sample} #{cooking_style.sample} #{food.sample}" | ||
end | ||
|
||
# Test for the following: | ||
# | ||
# The menu items are selected randomly. | ||
# There are 10 menu items. | ||
# Each item should pull one word from each of the 3 arrays. | ||
# The items are numbers 1-10 (not starting at zero). | ||
# Run the program a few times and ensure that the last word in the arrays are used. | ||
# Also ensure that the first word in the arrays are used at least occasionally. | ||
|
||
|
||
# ****** Additional Considerations/Challenges ***** | ||
# Expand your solution to ensure that no descriptive term in a menu item is ever repeated. | ||
# So if the first menu item is hot pan-fried dumplings, the the phrases hot, | ||
# pan-friend and dumpling cannot individually be used in any other menu items. | ||
|
||
# 10.times do |num| | ||
# a = adjectives.sample | ||
# b = cooking_style.sample | ||
# c = food.sample | ||
# puts "#{num+1}. #{a} #{b} #{c}" | ||
# adjectives.delete(a) | ||
# cooking_style.delete(b) | ||
# food.delete(c) | ||
# end | ||
|
||
# Expand your solution to allow the user to determine how many items they'd | ||
# like to see via user input. Note: You will need to ensure that this user-chosen number of items is not larger | ||
# than the number of items you have in your arrays. | ||
|
||
# puts "How many items would you like to see?" | ||
# items = gets.chomp.to_i | ||
# until items <= 10 | ||
# puts "Please select a number under 10." | ||
# items = gets.chomp.to_i | ||
# end | ||
# | ||
# items.times do |num| | ||
# a = adjectives.sample | ||
# b = cooking_style.sample | ||
# c = food.sample | ||
# puts "#{num+1}. #{a} #{b} #{c}" | ||
# adjectives.delete(a) | ||
# cooking_style.delete(b) | ||
# food.delete(c) | ||
# end | ||
|
||
# Instead of using hardcoded or predefined arrays, make your program accept user input. | ||
# This user input will be utilized to generate the menu items. | ||
# You'll need to prompt for and store a varying number of entries for each food-type array. | ||
# adjectives = [] | ||
# cooking_style = [] | ||
# food = [] | ||
# | ||
# puts "Please enter 10 food adjectives." | ||
# 10.times do |entry| | ||
# adjectives << gets.chomp | ||
# end | ||
# | ||
# puts "Please enter 10 food preparation techniques (past tense)." | ||
# 10.times do |entry| | ||
# cooking_style << gets.chomp | ||
# end | ||
# | ||
# puts "Please enter 10 different food items." | ||
# 10.times do |entry| | ||
# food << gets.chomp | ||
# end | ||
# | ||
# 10.times do |num| | ||
# puts "#{num + 1}. #{adjectives.sample} #{cooking_style.sample} #{food.sample}" | ||
# end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a clever way of making sure elements are unique.