A compact Python terminal game (<100 lines) where you play Tic-Tac-Toe against a computer opponent that makes random valid moves.
- Classic 3×3 Tic-Tac-Toe gameplay
- Play as X, computer plays as O
- Computer makes random valid moves
- Detects win, draw, and invalid input
- Runs entirely in the terminal, no extra libraries required
- Clone this repository
git clone https://github.com/<your-username>/100LinesOfPythonCode.git cd "#1001_tictactoe_vs_ai"
- Run the python file
- python ./tictactoe_vs_ai.py