Skip to content

random_menu_Tamira #36

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

random_menu_Tamira #36

wants to merge 2 commits into from

Conversation

tvojnar
Copy link

@tvojnar tvojnar commented Aug 10, 2017

Random Menu

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
How did you store menu components? Why? I stored my menu items in arrays because each element in the array was independent and didn't need to be stored with an associated key in a hash.

| 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 stored the menu items in a hash. For example the keys could have been numbers and the values could have been my menu items. |
| Did you find yourself repeating the same code? Why did you have to do it that way? | The only code that I repeated was in the enhanced version where I wrote three times loops to fill the arrays for menu items. I could have combined this into a single times loop, but I liked filling each array one at a time instead of cycling though them. |
| What type of loop did you use? Why did you choose that type? | I used times loops and counter controlled loops. I used the times loops because I knew how many times I wanted to run though those loops to fill in the menu items. I used counter controlled loops to get the user input for how many menu items they wanted to see, as well as for generating the random menu. This is because I wanted to use the counter variable in my loops, and I couldn't predict in advance how many times the loops would need to run. |

@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
Comprehension Q's Would you really want to make a hash where all the keys were numbers? Would there be any benefit to having that over the array? If so, expand. If not, leaving it as an array would be an adequate answer.
If you are using a counter anyway, is there any benefit to using the loop versus using the .times method with the argument? Have a look at .times documentation (https://ruby-doc.org/core-2.2.2/Integer.html#method-i-times) and notice how there is the argument between the pipes, how could you refactor your loop do so that you do not need to have a counter variable? (relating to your original solution, it looks like you changed this in your enhanced. Nice! However, is 'loop do' in the enhanced version actually doing anything?)
Submission meets expectations and learning goals for this project. 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