Play Tic Tac Toe
To play Tic Tac Toe always ends in a draw if no wrong moves are made. However, [one of] the correct answers must be made to the initial move, or you lose with O against X.
The computer opponent here should not make any mistakes and always achieve at least the draw. Because of the simplicity of the game with few branches, all possibilities can be calculated in each case.
Source Code on github
Change to play connect four.