This script is the engine of the game. It keeps track of the moves that have been made, handles sharing turns between the human player and the computer AI, and determines who wins.


This is where the tic-tac-toe object is created and the interface configured. I try to keep tic-tac-toe.js free of HTML and the HTML portion free of javascript.