Skip to content

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