Skip to content

Conversation

@Priscillesg
Copy link

No description provided.

Copy link

@audreyandoy audreyandoy left a comment

Choose a reason for hiding this comment

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

Good work Priscille! You met the learning goals for this project. You're just missing the reset button but I've added a hint and we can go over it together.

// You will need to create a method to change the square
// When it is clicked on.
// Then pass it into the squares as a callback
const [currentPlayerX, setCurrentPlayerX] = useState(true);

Choose a reason for hiding this comment

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

Good use of state to keep track of the current player.

Comment on lines 7 to 8
const PLAYER_1 = 'X';
const PLAYER_2 = 'O';

Choose a reason for hiding this comment

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

It seems like you aren't using these 2 variables anywhere in your project. You could probably leave them out?

}
}
return null;
}

Choose a reason for hiding this comment

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

There's something in the game logic here that is failing a test. Remind me to go over that with you during our next 1:1.

Choose a reason for hiding this comment

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

You're not checking for empty values in any of these combinations so I wonder if that's what is making one of the tests fail.

<h1>React Tic Tac Toe</h1>
<h2>The winner is ... -- Fill in for wave 3 </h2>
<h2>Winner is {checkForWinner(squares)}</h2>
<button>Reset Game</button>

Choose a reason for hiding this comment

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

The reset button isn't quite working but here is a hint to get it to work:

  1. Add an onclick event to this button that will call a function
  2. The function will reset the squares state so that it is freshly generated and the winner is empty.

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