This is a tictactoe game with two levels of difficulty: easy and impossible. The impossible mode was achieved using the recursive minimax algorithm. The easy mode is random.
Here is a link to a live demo: https://friedrichtenhagen.github.io/tictactoe/
I started with letting the computer make random moves. This is far too easy to beat for most humans, so i researched the optimal way of playing the game. Using the minimax algorithm it is possible for the computer to recursively evaluate all future moves.
This project was a great exercise in javascript. I was able to use my existing knowledge about DOM manipulation. A module was used to keep all internal functions private. Objects for the board and the players are used to store information. Furthermore, I used the recursive minimax algorithm, which was a fun challenge.