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 - Cynthia Cobb's Random Menu #36

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cynthiacd
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? yes - I would make the keys the array names, and the values would be the arrays. I could than access the arrays by using hash_name[:key_name]
Did you find yourself repeating the same code? Why did you have to do it that way? I A bit I had to call .sample and .delete on each array because there were 3 arrays
What type of loop did you use? Why did you choose that type? I used a times iteration loop because I wanted to control the number of times the loop ran (IE how many menu items were printed) and I wanted to be able to use the index value to label each item (I made sure to do i + 1 so the printed starts at 1 and ends at the number of items you want)

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

Excellent work overall!

print "How many menu items would you like? (max 10): "
number_of_items = gets.chomp.to_i
end
return number_of_items

Choose a reason for hiding this comment

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

Indentation (just the one line between the ends).

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