Skip to content

Conversation

@psc478
Copy link
Owner

@psc478 psc478 commented Nov 27, 2017

Checkpoint Rubric

This is the rubric that your instructor will use to grade your checkpoints. Please do not edit.

Checkpoint 1

  • All tests passed: 40 points
  • Proper use of documentation (commenting on code): 15 points
  • Properly indented code: 15 points
  • Demonstrated effective use of JavaScript: 30 points

Checkpoint 2

  • The application works as it should: 40 points
  • Proper use of documentation (commenting on code): 15 points
  • Properly indented code: 15 points
  • Demonstrated effective use of JavaScript and the DOM API: 30 points

Checkpoint 3

  • Use of React: 25 points
  • Accesses an API: 25 points
  • Proper use of documentation (commenting on code): 25 points
  • The application functions as it should: 25 points

console.log("Task: "+task);
console.log("Board: "+this.state.board);
this.setState(newState);
checkForWin(this);
Copy link

@yousifS yousifS Dec 1, 2017

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)){
Copy link

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.

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.

3 participants