Tic Tac Toe

Overview

2 player game x and o

date

March 2016

tools used

HTML, SCSS & jQuery

How

Create a grid of 3 * 3 in html and add class names to each square. Use a count to keep track of clicks and add either an x or o to the grid on click of a square. Run checks that cover a win or draw scenario based on the text content within the grid. Display the result and add an option to restart the game.

Learnt

Testing html content from users clicks. Keeping track of turns. Updating the dom. Refreshing the page on click. Basic game logic.

See the Pen Tic Tac Toe by Harry Beckwith (@fun) on CodePen.

← Back to all projects