Here's an example of a Tic Tac Toe game implemented as a single HTML file using JavaScript:
This implementation allows you to play Tic Tac Toe against an AI opponent on a 3x3 grid. The X player always goes first, and the AI player (O) makes random moves. The game will detect if a player wins or if it's a draw, and then it allows you to start again by clicking the cells.
Note: This is a basic implementation and does not include advanced AI strategies.