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

Queues - Erica J. Case - Random Menu #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

EricaJCasePhD
Copy link

Random Menu

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
Would a hash work just as well as an Array in this project? Why? Probably not--you can't control order in a hash and so you would have to do more complicated code to track which adjective, preparation styles, and foods. Also, there is no intuitive key for each of the values.
Did you find yourself repeating the same code? Why did you have to do it that way? I repeated the same code for each of the 3 arrays; I had to do it that way because I thought it would be more clear than creating a hash of arrays to shuffle all the arrays through iterations.
What type of loop did you use? Why did you choose that type? I used a times loop because I knew how many times I wanted the loop to repeat in advance (the length of the arrays)

@EricaJCasePhD
Copy link
Author

EricaJCasePhD commented Feb 9, 2017

I realize my last comment code somehow got deleted mid-comment! Oops!

Also, I meant to say for question 1: you would have to track which values/keys had been used.

Copy link

@droberts-sea droberts-sea left a comment

Choose a reason for hiding this comment

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

Random Menu

What We're Looking For

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

Good work overall!


adj.shuffle!
prep.shuffle!
foods.shuffle!

Choose a reason for hiding this comment

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

Nice use of shuffle! This is a clever way to get a random order without destroying the array as you go along.

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

Successfully merging this pull request may close these issues.

2 participants