A console-based Tic Tac Toe game built in Python featuring multiple difficulty levels including an unbeatable AI using the Minimax algorithm.
-
🧑🤝🧑 Player vs Player mode
-
🤖 Player vs Computer mode
-
🎯 3 Difficulty levels:
- Easy (Random moves)
- Medium (Win/Block strategy)
- Hard (Minimax AI - Unbeatable)
-
🔄 Dynamic symbol selection (X / O)
-
🧠 Smart AI decision-making
-
🖥️ Clean terminal-based UI
- Random valid move
- Try to win
- Block opponent
- Otherwise random
- Simulates all possible outcomes
- Chooses optimal move
- Never loses
git clone https://github.com/Sahdevagarwal/Tic_Tac_Toe.git
cd Tic_Tac_Toe
python main.pyEnter positions from 1 to 9:
1 | 2 | 3
---------
4 | 5 | 6
---------
7 | 8 | 9
MIT License
Sahdev Agarwal https://github.com/Sahdevagarwal