Skip to content
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
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Bianca menu gen #23

wants to merge 1 commit into from

Conversation

biciclista22
Copy link

@biciclista22 biciclista22 commented Aug 10, 2017

Random Menu

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
How did you store menu components? Why? I stored the menu components in arrays, in part because it was stated in the directions, but it is also indexed and there wasn't a need to create key value pairs that would normally call for a hash. Because the values were going to be selected at random, an array allowed for some order without it needing to be attached to a key.
Could you have stored components using a different data structure? For example, if you used an Array could you have used a Hash? I don't think a hash would have been that beneficial because the emphasis was not really on key value pairs. Perhaps I could have created an array of hashes, with each hash containing a selection of values for the three main categories, which I would have created into symbol values. I liked using the array instead because it allowed me to leverage the index of each value to create a random selection.
Did you find yourself repeating the same code? Why did you have to do it that way? I didn't necessarily repeat code until I worked on some of the optional problems. In particular, the section that asks for user input, I had to repeat the questions three times because it was asking for different kinds of input.
What type of loop did you use? Why did you choose that type? I used a times loop to run 10 times and iterate through the 3 arrays. A times loop allows me to give a specific number of times the I want the loop to run - the instructions asked for 10 menu items, so it was easy to set that to 10.

@droberts-sea
Copy link
Collaborator

Random Menu

What We're Looking For

Feature Feedback
Random Menu of 10 items displayed in the terminal. yes
Generator pulls one random item from each array to create menu items. yes
Baseline
Readable code with consistent indentation. yes

Great work overall! Good job on the optionals.

# b = cooking_style.sample
# c = food.sample
# puts "#{num+1}. #{a} #{b} #{c}"
# adjectives.delete(a)
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants