A game in which two players seek in alternate turns to complete a row, a column, or a diagonal with either three O's or three X's drawn in the spaces of a grid of nine squares; noughts and crosses.
class Player{}
Creates the different players.
class Game{}
Creates the game board as an array.
createPlayers(player1, player2)
Uses the class Player funtion to create the 2 players.
place(x, symbol)
Places the 2 symbols into the gameboard array.
win()
Checks the winning conditions.
gameDisplay()
Shows the gameboard and hides the player input.
winner()
Displays the winner at the end of the game.
draw()
Announces if the game end in a draw.
names()
Displays the players names on each side of the gameboard.
removeHandler()
Removes the click event of already filled spaces.
clickPlace()
Adds a click event to the empty spaces of the gameboard and places the different symbols.
restart()
Reloads the page.
init()
Starts the game functions.