-
Notifications
You must be signed in to change notification settings - Fork 48
Space - Sara Nilsen #24
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
base: master
Are you sure you want to change the base?
Conversation
…there is no clicking options
React Tic Tac ToeMajor Learning Goals/Code Review
Functional Requirements
Overall Feedback
Code Style Bonus AwardsWas the code particularly impressive in code style for any of these reasons (or more...?)
|
| const values = allMySquaresValues(); | ||
|
|
||
| } | ||
| const lines = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clever!
| } | ||
| }; | ||
|
|
||
| const allMySquaresValues = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that you pulled this out into a helper method!
Given that your solution lends itself to wanting to check the winner by looking at a 1-dimensional array, it would be an appropriate optimization to change the generateSquares function to just create a 1-D array from the beginning and use that as your state.
Truth be told, the main reason we set it up as a 2-D array is because we believed it would help many people with writing code to determine the winner.
But that's just an optimization! Not a significant problem with your code :)
React Tic Tac Toe
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.
Reflection
useStateconnected?CS Fundamentals Questions
setState-- it must re-render all of the components that now have different content because of that change. Speculate wildly about what the Big-O time complexity of that code might be.