"use strict" let playerTurn = true; let computerMoveTimeout = 0; const gameStatus = { MORE_MOVES_LEFT: 1, HUMAN_WINS: 2, COMPUTER_WINS: 3, DRAW_GAME: 4 }; window.addEventListener("DOMContentLoaded", domLoaded); function domLoaded() { // Setup the click event for the "New game" button const newBtn = document.getElementById("newGameButton"); newBtn.addEventListener("click", newGame); // Create click-event handlers for each game board button const buttons = getGameBoardButtons(); for (let button of buttons) { button.addEventListener("click", function () { boardButtonClicked(button); }); } // Clear the board newGame(); } // Returns an array of 9