Skip to content

Conversation

@copelandhouse2
Copy link
Owner

Recreating Tic Tac Toe game in the browser

  • Using DOM API commands and javascript.

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.

Craig, nice job. I really like the es6 array methods.

[0,1,2], [3,4,5], [6,7,8], // horizontal wins
[0,3,6], [1,4,7], [2,5,8], // vertical wins
[0,4,8], [2,4,6] // diagonal wins
];

Choose a reason for hiding this comment

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

nice!! I like the idea of arrays here

mySquares.forEach(aSquare => {
aSquare.addEventListener("click", square => {
// display the current click count inside the clicked div
if (!square.target.textContent) {

Choose a reason for hiding this comment

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

nice method

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