-
Notifications
You must be signed in to change notification settings - Fork 0
Tic tac toe #11
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?
Tic tac toe #11
Conversation
| console.log("Task: "+task); | ||
| console.log("Board: "+this.state.board); | ||
| this.setState(newState); | ||
| checkForWin(this); |
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.
if you define the checkFor functions as functions of the component instead of inner functions inside placeSymbol function, then you can call it as this.checkForWin() and you would not have to pass in this as the first argument.
|
|
||
| let task = event.target.getAttribute("data-cell"); | ||
|
|
||
| if ((this.state.playerTurn==="X")&&(this.state.board[task]===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.
the if and else code is almost the same, you could have just figured out the Symbol to play in there, and the rest of the code could have been outside. the block, so you would not have to repeat your self.
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