Tic Tac Toe

Game Logic
Use of Parcel Builder
JS Destructuring

The Brief

Without researching other implementations of the game, I wanted to see how far my js skills had come to recreate the game from scratch. Minimal styling and a focus on creating a efficient functioning game.

The Build

Before starting this project I ran through a few ways to structure the game and considered their implications later on in the build. I wanted as few calculations as possible in determining a winner so initially added checks in the code to only count if a win was possible and to stop if one had already been found. I decided to run two sections: the physical board seen by the user and an array used by the browser.

By tabulating all the possible winning moves it meant that the code would only check those possibilities.

After getting a running project, I came back to add more features on an iterative basis. These included messages, implementation for a draw and a running scoreboard.

Inspect the Code Visit the Site