From 5e0dc5d2b4d6d6d99d7937856d74c54a96a5b595 Mon Sep 17 00:00:00 2001 From: gauriarjariyacodingclub <68989083+gauriarjariyacodingclub@users.noreply.github.com> Date: Fri, 2 Oct 2020 11:26:11 +0530 Subject: [PATCH] Update script.js --- script.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/script.js b/script.js index f1b332f..eea3010 100644 --- a/script.js +++ b/script.js @@ -1,5 +1,5 @@ -const X_CLASS = 'x' -const CIRCLE_CLASS = 'circle' +const X_CLASS = 'x'; +const CIRCLE_CLASS = 'circle'; const WINNING_COMBINATIONS = [ [0, 1, 2], [3, 4, 5], @@ -10,16 +10,16 @@ const WINNING_COMBINATIONS = [ [0, 4, 8], [2, 4, 6] ] -const cellElements = document.querySelectorAll('[data-cell]') -const board = document.getElementById('board') -const winningMessageElement = document.getElementById('winningMessage') -const restartButton = document.getElementById('restartButton') -const winningMessageTextElement = document.querySelector('[data-winning-message-text]') -let circleTurn +const cellElements = document.querySelectorAll('[data-cell]'); +const board = document.getElementById('board'); +const winningMessageElement = document.getElementById('winningMessage'); +const restartButton = document.getElementById('restartButton'); +const winningMessageTextElement = document.querySelector('[data-winning-message-text]'); +let circleTurn; startGame() -restartButton.addEventListener('click', startGame) +restartButton.addEventListener('click', startGame); function startGame() { circleTurn = false @@ -86,4 +86,4 @@ function checkWin(currentClass) { return cellElements[index].classList.contains(currentClass) }) }) -} \ No newline at end of file +}