Skip to content

Conversation

@sheland
Copy link

@sheland sheland commented Aug 7, 2018

Random Menu Generator

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
For the places where arrays were used, could using a hash work? Could it work easily? Why or why not? yes. I created arrays with stored elements
Did you find repetitions of the same or similar code? Why did you have to do it that way? Yes, the elements in the arrays did repeat.
Did you use any loops? If so, how did it help solve a problem? yes, but I was only able to loop it one times.

@CheezItMan
Copy link

Random Menu Generator

What We're Looking For

Feature Feedback
A random menu of 10 items are displayed in the terminal Your code does not work
The code that generates the random menu pulls one random item from each array to create menu items See above
Readable code with consistent indentation You are meshing your code together very tightly. Take a look at our textbook code and the example code I worked on yesterday, see if you can emulate the style a bit. Yours can be hard to read and debug because it's so compact. Also your indentation is a little odd, you are indenting things that are not within the block of the previous line for example.
Summary Some of your comprehension question answers don't exactly match the questions. In others you didn't answer the 2nd part of the question. Next time read a bit more carefully. Further your code doesn't run and when I fixed the syntax errors only produced one random menu item. When you are having trouble with a project it's important that you reach out and let us know and get help.



result_a = []
1.times { result_a << adjectives.slice!( rand(adjectives.size) ) }

Choose a reason for hiding this comment

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

Why is this indented?


result_f = []
#1.times { result_f << foods.slice!( rand(foods.size) ) }
1.times { result_f << foods.slice!(rand(foods)}

Choose a reason for hiding this comment

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

Missing a close parentheses & instead of foods this should be foods.length

1.times { result_f << foods.slice!(rand(foods)}

random_food_item = result_a + result_c + result_f
(1...2).each do

Choose a reason for hiding this comment

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

This is only doing 1 food item

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