Skip to content
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

Paper - Weishan #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

Weishanyang33
Copy link

No description provided.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

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

Nice work Weishan, you hit the learning goals here. Well done.


// Wave 2
// 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 updateBoard = (id) => {

Choose a reason for hiding this comment

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

👍


const checkBoard = (player) => {

Choose a reason for hiding this comment

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

Good use of a loop. Do you need the parameter?

} else if (squares[0][2].value === squares[1][1].value && squares[1][1].value === squares[2][0].value && squares[2][0].value === squares[0][2].value && squares[0][2].value === player) {
return true;
};
return false;
}

const resetGame = () => {

Choose a reason for hiding this comment

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

You also should reset the current player here.

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