Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Random Menu Generator
Congratulations! You're submitting your assignment.
Comprehension Questions
| For the places where arrays were used, could using a hash work? Could it work easily? Why or why not? | Yes, but it would require more information. We'd have to create a value with numbers for each item anyway so we had a way to randomly select the items. One upside of a hash might be creating a boolean value for whether or not an item had been selected before - this would allow us to flag an item without deleting the information (I replaced words with 0 once they were chosen). |
| Did you find repetitions of the same or similar code? Why did you have to do it that way? | Originally I had repetitive code for the selection of words from the adjectives, cookstyles, and foods arrays, but I replaced that with a method after reviewing with my partner in class. |
| Did you use any loops? If so, how did it help solve a problem? | Yes, I used loops to: 1. populate the arrays, 2. To select items and make sure they hadn't been used already, and 3. to create the final menu. These were all repetitive tasks and using a loop allowed the user to control how many times they occurred by defining the menu size. |