Live Demo 👉 A game of tic tac toe
Project Tic Tac Toe has been set as part of The Odin project. Create a game of tic tac toe whilst ensuring to use as little global code as possible, by tucking everthing away inside of a module or factory. Skills learnt from the prevoiuse lesson Factory Functions & The Module Pattern.
- Create a browser based game of Tic Tac Toe
- The main goal is to use as little global cosed as possible. Try tucking everything away inside of a module or factory.
- Set up your HTML and write a JavaScript function that will render the contents of the gameboard array to the webpage (for now you can just manually fill in the array with "X"s and "O"s.
- Build the functions that allow players to add marks to a specific spot on the board, and then tie it to the DOM, letting players click on the gameboard to place their marker.
- Build the logic that checks for when the game is over! Should check for 3-in-a-row and a tie.
- Clean up the interface to allow players to put in their names, include a button to start/restart the game and add a display element that congratulates the winning player!
- Create an AI so that a player can play against the computer! Start by just getting the computer to make a random legal move.
- Work on making the computer smart. It is possible to create an unbeatable AI using the minimax algorithm
Rozla-Dev 31-03-2023