Tic Tac Toe

HTML, JavaScript, and SVG

Play Again

Objective: Make a Tic Tac Toe game. Detect when someone has won and prevent further play. Show which user won. Implement a New Game button. Draw the X's and O's using SVG.

Problem: How do we know when someone won?

Solution: If you number the squares from 1 to 9, each winning pattern has a mathematical relationship. We can exploit these relationships to write simpler code.