Skip to content

Queues - Janice Lichtman - Random Menu #47

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 2 commits into
base: master
Choose a base branch
from
Open

Conversation

J-C-L
Copy link

@J-C-L J-C-L commented Feb 9, 2017

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? This project was well suited to arrays. To get a set of non-repeating, randomly chosen values from each list (cooking descriptors, cooking styles, and foods), I used the sample method, which outputs an array. I was then able to call one of each by index number. This project could be re-written in hashes, but I don't see a strong benefit to that.
Did you find yourself repeating the same code? Why did you have to do it that way? I mostly used loops to avoid repeating much codes
What type of loop did you use? Why did you choose that type? I used each loops and times loops, since I wanted to repeat the same action a given number of times. Iterating over a range of numbers was also useful since my data was stored in arrays, and thus had numeric indexes.

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
User can specify how many menu items to see Yes
User can specify their own food items Yes

Excellent work!

random_foods = foods.sample(menu_number)


puts random_descriptors

Choose a reason for hiding this comment

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

Usually you'll want to remove debug output before turning in a project.

@J-C-L
Copy link
Author

J-C-L commented Feb 11, 2017 via email

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