Skip to content

Conversation

@walzer85
Copy link
Owner

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

Copy link

@reneemeyer reneemeyer left a comment

Choose a reason for hiding this comment

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

Your logic is sound, we just need to get the syntax straightened out. Remember to test your code every line that you write, Javascript is meant to be run.

function horizontalWin() {
// Your code here
//horizontalWin(), checks if there are three X's or O's in [0][0], [0][1], [0][2], etc, indexOf method
if (printBoard.indexOf(printBoard) === ((([0][0]) && [0][1] && [0][2]) || ([1][0] && [1][1] && [1][2]) || ([2][0] && [2][1] && [2][2])) {

Choose a reason for hiding this comment

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

Why are you checking for the index of printBoard in printBoard? This would be -1 unless there was an instance of printBoard inside of printBoard...

function verticalWin() {
// Your code here
//verticalWin(), checks if there are th ree X's or O'ss in [0][0], [1][0], [2][0]; [0][1], [1][1], [2][1]; [0][2], [1][2], [2][2]; indexOf method
if (printBoard.indexOf(printBoard) === ((([0][0]) && [1][0] && [2][0]) || ([0][1] && [1][1] && [2][1]) || ([0][2] && [1][2] && [2][2])) {

Choose a reason for hiding this comment

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

Why are you checking for the index of printBoard in printBoard? This would be -1 unless there was an instance of printBoard inside of printBoard...

function diagonalWin() {
// Your code here
//diagonalWin(), checks if there are three X's or O's in [0][0], [1][1], [2][2]; [0][2], [1][1], [2][0]; indexOf method
if (printBoard.indexOf(printBoard) === ((([0][0]) && [1][1] && [2][2]) || ([0][2] && [1][1] && [2][0])) {

Choose a reason for hiding this comment

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

Why are you checking for the index of printBoard in printBoard? This would be -1 unless there was an instance of printBoard inside of printBoard...

//ticTacToe(), begin the game with player X
print(row, column)
//playerXTurn(), set playerTurn to 'X' - place an X in the column/row that player X chooses, splice method on var board
checkForWin

Choose a reason for hiding this comment

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

This throws and error, your calling a checkForWin variable here not a function.

print(row, column)
//playerXTurn(), set playerTurn to 'X' - place an X in the column/row that player X chooses, splice method on var board
checkForWin
let playerTurn = 'O';

Choose a reason for hiding this comment

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

This would throw and error, you already declared playerTurn. If you want to re-assign, it would be playerTurn=''O"

//playerOTurn(), change playerTurn to 'O' - switch to player O, place an O in the column/row that player O chooses, splice method on var board
//switch back to player X, run the same code again
checkForWin
let playerTurn = 'X';

Choose a reason for hiding this comment

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

This would throw and error, you already declared playerTurn. If you want to re-assign, it would be playerTurn=''O"

let playerTurn = 'O';
//playerOTurn(), change playerTurn to 'O' - switch to player O, place an O in the column/row that player O chooses, splice method on var board
//switch back to player X, run the same code again
checkForWin

Choose a reason for hiding this comment

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

This throws and error, your calling a checkForWin variable here not a function.

checkForWin
let playerTurn = 'X';
//Between every turn, run checkForWin
checkForWin;

Choose a reason for hiding this comment

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

This throws and error, your calling a checkForWin variable here not a function.

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