Skip to content

whiteboarding details and completed mark on the board and alternate b…#5

Open
melonunderground wants to merge 3 commits intogh-pagesfrom
class5-tictactoe
Open

whiteboarding details and completed mark on the board and alternate b…#5
melonunderground wants to merge 3 commits intogh-pagesfrom
class5-tictactoe

Conversation

@melonunderground
Copy link
Owner

…etween players. stuck on win functions

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

(board[1][0] === playerTurn && board[1][1] === playerTurn && board[1][2] === playerTurn) ||
(board[2][0] === playerTurn && board[2][1] === playerTurn && board[2][2] === playerTurn)) {
return true;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look up an array method that checks if EVERY item in the array is the same. this will cut down your code.

(board[0][1] === playerTurn && board[1][1] === playerTurn && board[2][1] === playerTurn) ||
(board[0][2] === playerTurn && board[1][2] === playerTurn && board[2][2] === playerTurn)) {
return true;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above. you can refactor with a method

if ((board[0][0] === playerTurn && board[1][1] === playerTurn && board[2][2] === PlayerTurn) ||
(board[0][2] === playerTurn && board[1][1] === playerTurn && board[2][0] === playerTurn)) {
return true;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^^^

Copy link

@stephsingler stephsingler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start! Since you're ahead you should try and look up a method that will cut down you having to hard code every single instance of the board

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.

2 participants