-
Notifications
You must be signed in to change notification settings - Fork 0
Class14 tictactoe #12
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: gh-pages
Are you sure you want to change the base?
Conversation
reneemeyer
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.
Nice job! Just a few issues to address.
| this.state = { | ||
| turn: 'X', | ||
| }; | ||
| this.message = ''; |
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.
why is message outside of the state?
| ['cell2','cell4','cell6'] | ||
| ]; | ||
| // Set iterator to loop over all winning scenario arrays | ||
| for (var i in winningPositions) { |
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.
don't use for loop, use map or forEach
| && state[winningPositions[i][1]] === playerTurn | ||
| && state[winningPositions[i][2]] === playerTurn) { | ||
| // Use playerTurn variable to create a variable to hold the winningMessage | ||
| let winningMessage = `${playerTurn} is the winner!` |
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.
this should be const
Checkpoint Rubric
This is the rubric that your instructor will use to grade your checkpoints. Please do not edit.
Checkpoint 1
Checkpoint 2
Checkpoint 3