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 - Allison Northrop - Random Menu #41

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

Conversation

Allison-Northrop
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? One could use a hash, however it's unnecessary. In this case an array is faster because there's no need to have the elements in each array linked to any sort of key.
Did you find yourself repeating the same code? Why did you have to do it that way? I didn't repeat any code. I used a .times loop to iterate over the three arrays and print out 10 random menu items. While I didn't have any repeat code, I didn't put a qualifier on having the elements in the array repeated. As it stands now, one of the elements in any array could be used more than once.
What type of loop did you use? Why did you choose that type? I chose a .times loop because it was the least complicated way to print the 10 randomly generated menu items.

@Allison-Northrop
Copy link
Author

I realized I forgot to number the menu items. I fixed this in my code by doing this on the .times loop: 10.times do |i|
puts "#{i + 1} #{adjective_array.sample} #{cooking_array.sample} #{food_array.sample}"
end

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

Good work!

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