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

Pipes Lauren Menu #37

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Pipes Lauren Menu #37

wants to merge 5 commits into from

Conversation

laurenelee
Copy link

Random Menu

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
How did you store menu components? Why? These are all answers for the code that asks for user input as opposed to the pre-written array option: I stored the menu options an array, based on user's gets.chomp. I chose to store them in three different arrays based on the questions I asked the user.
Could you have stored components using a different data structure? For example, if you used an Array could you have used a Hash? Yes, absolutely. Although as I understand it, hashes are best used when the data is stored in pairs... which I don't believe this data is, but perhaps I am not thinking of this correctly. BUT, I certainly could have created an array WITHIN my array to reduce my duplicate code (DRY) moments which are driving me crazy!
Did you find yourself repeating the same code? Why did you have to do it that way? Unfortunately, yes. I repeated code when I shoveled (<<) the user's answers into the separate arrays. Also, I think there might be a way for me to not shuffle ALL of the arrays individually, but to do it in just one line.
What type of loop did you use? Why did you choose that type? I used a .times loop because my user was choosing a number of menu options they wanted to see. I could have used a .until or .while loop and wrote something like, "until num == gets.chomp"

@laurenelee laurenelee changed the title random_menu.rb Pipes Lauren Menu Aug 11, 2017
@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!
Baseline
Readable code with consistent indentation. Well done!
Extras
Nice refactor of calling .sample outside of the loop. Great thorough answers to the comprehension questions.
Submission meets project expectations and learning goals. Nice work!

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