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

Lauren C.'s random_menu_generator.rb #48

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

Conversation

enigmagnetic
Copy link

Random Menu

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
How did you store menu components? Why?
I stored the menu components using an array, because I needed a list for three different types of components.
Could you have stored components using a different data structure? For example, if you used an Array could you have used a Hash?
I could have used an array of hashes to store the randomized components as menu items, i.e. menu_items = [{ adj: "Spicy", method: "Fried", food: "Chicken"}, etc.]
Did you find yourself repeating the same code? Why did you have to do it that way?
I did find myself repeating the code to prompt the user for different types of words, and checking that the input was sufficient for the menu. I refactored my code after watching today's lesson on methods, and made a prompt method to reduce repetition.
What type of loop did you use? Why did you choose that type?
I used two loops: A) an until loop within the prompt method to ensure the user entered enough words to fill the menu, and b) a times loop to display the randomized input combinations as a menu.

@CheezItMan
Copy link

Random Menu

What We're Looking For

Feature Feedback
Random Menu of 10 items displayed in the terminal. Check
Generator pulls one random item from each array to create menu items. Check, nice use of sample to randomize the adjectives, methods and foods array.
Baseline
Readable code with consistent indentation. Check
Extras Allows the user to pick the number of items and enter their own words. Prevents duplication of words
Summary Nicely done, you hit all the requirements and extras!

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