Found here is a working, one page implementation of TicTacToe using css, html, javascript, and jquery. The game includes an unbeatable computer algorithm, though perhaps not the one you would expect.
Your task, if you choose to accept it, is to refactor this code. The approaches are limitless. The goals are to practice creating seams, write tests for legacy code, and refactor while keeping the tests passing.
To play the game, one should be able to simply open the file using any modern browser. To begin simply click a square.
There are three ways to play:
- One Player, Player Goes First
- One Player, Computer Goes First
- Two Players
Thank you to Dave Moore the author of the original code, and the refactoring challenge.