Skip to content

Pipes - Sarah Read-Brown - Random Menu #42

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

Conversation

SRBusiness
Copy link

Random Menu

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
How did you store menu components? Why? My menu components were stored into an array nested in another array.
Could you have stored components using a different data structure? For example, if you used an Array could you have used a Hash? Since the order didn't matter and we wanted it to be random the menu components could have been stored into a hash, likely a hash inside of an array.
Did you find yourself repeating the same code? Why did you have to do it that way? I had to use two separate time loops in my code. I did my best to combine my code and when I saw that I was repeating my self gathering the user input I was able to combine that section of code into one nested loop.
What type of loop did you use? Why did you choose that type? I ended up using a couple different types of loops in this project. I used an until loop for ensuring that users input matched the criteria for the number of menu items. I used a nested times loop to gather the users input on food types, adjectives, and cooking methods. Finally I used another a time loop to print the menu items. I choose each of these loops because they seemed like the most efficient way to approach the problem.

@PilgrimMemoirs
Copy link

Random Menu

What We're Looking For

Feature Feedback
Random Menu of 10 items displayed in the terminal. Well Done
Generator pulls one random item from each array to create menu items. Well Done - One thing to think about, is 'array' a good name for the array that holds the other arrays? How could it be more descriptive of what it's holding? And if you are creating a new data structure to hold all your arrays what made you chose array over hash? I think that hash would have been a good option so that the key names would give context to what that array holds. For example, later in your program you have to get values from all those arrays with this: array[0].sample, which gives me no context to what this array is or what it is sampling from.
Baseline
Readable code with consistent indentation. Well Done
Extras
If the optionals are going to change your original solution significantly, please comment out your original version and copypasta it to make any further changes. While providing feedback, we focus on the requirements.
Comprehension Q's I would like to see the 2nd question expanded on, would there be any advantage to having a hash over an array? What would the keys be and how would it change the nature of the program? If you do not see any additional benefit, an adequate answer could be leaving it as an array, but with an explanation on why there would be no benefit in having a different structure.
Submission meets the project's expectations and learning goals. Nice work!

@SRBusiness SRBusiness changed the title Create random_menu.rb Pipes - Sarah Read-Brown - Random Menu Aug 11, 2017
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