My goal in this mini-project was to practice building and working with JavaScript modules. This simple game works by attaching event listeners to player choices (divs from the DOM that are pulled into an array); when clicked, they read the state of the game to determine what marker should be placed ('X' or 'O') and then check if the game has ended using another module's functions. If the game has ended, it displays an appropriate message. If it hasn't, it increments the turn and updates the HTML to tell the player what turn it is and which player will be selecting.
chayre / js-tic-tac-toe Goto Github PK
View Code? Open in Web Editor NEWTic-Tac-Toe in JavaScript
Home Page: https://chayre.github.io/JS-tic-tac-toe/