-
Notifications
You must be signed in to change notification settings - Fork 71
Rock - Priscille #51
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?
Rock - Priscille #51
Conversation
…y into 1D array Set squareComponents to an array of JSX elements using the function call squareList.map()
…n the player click on a button Removed the word skip in some tests to allow the test run the whole suite
…value of square.id
…tay the same after the second click
…when there is a winner
audreyandoy
left a comment
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.
Good work Priscille! You met the learning goals for this project. You're just missing the reset button but I've added a hint and we can go over it together.
| // You will need to create a method to change the square | ||
| // When it is clicked on. | ||
| // Then pass it into the squares as a callback | ||
| const [currentPlayerX, setCurrentPlayerX] = useState(true); |
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.
Good use of state to keep track of the current player.
| const PLAYER_1 = 'X'; | ||
| const PLAYER_2 = 'O'; |
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.
It seems like you aren't using these 2 variables anywhere in your project. You could probably leave them out?
| } | ||
| } | ||
| return null; | ||
| } |
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.
There's something in the game logic here that is failing a test. Remind me to go over that with you during our next 1:1.
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.
You're not checking for empty values in any of these combinations so I wonder if that's what is making one of the tests fail.
| <h1>React Tic Tac Toe</h1> | ||
| <h2>The winner is ... -- Fill in for wave 3 </h2> | ||
| <h2>Winner is {checkForWinner(squares)}</h2> | ||
| <button>Reset Game</button> |
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.
The reset button isn't quite working but here is a hint to get it to work:
- Add an onclick event to this button that will call a function
- The function will reset the squares state so that it is freshly generated and the winner is empty.
No description provided.