This is an unbeatable version of tic tac toe. This implementation uses the MiniMax algorithm and implements a heuristic that is based on the depth of the minimax search. A similar implementation is talked about here: Explanation of MiniMax. This implementation uses an unbeatable heuristic but could be limited in depth to give the player a chance.