This project is an AI-powered Tic-Tac-Toe game developed in Python. The AI agent is capable of playing using four different algorithms, providing a challenging opponent that can adapt to various strategies. The goal of this project is to explore different AI techniques for solving classic board games and compare their performance and decision-making processes.
- Minimax Algorithm: A basic AI that evaluates all possible moves to ensure the best outcome.
- Alpha-Beta Pruning: An optimized version of Minimax that reduces the number of nodes evaluated, making it faster.
- Heuristic-based Minimax: Adds heuristics to the standard Minimax for quicker decision-making without evaluating every possible move.
- Custom Strategy: A special strategy to add variety and new challenges to the game.
- Python 3
- Required libraries:
-OR on arch-
pip install tkinter
pacman -S tk
-
Clone the repository:
git clone https://github.com/3ab3z2/Tic-tac-toe.git
-
Navigate to the project folder:
cd Tic-tac-toe
-
Run the game:
python Trial.py
- On launching the game, you will be able to select which algorithm the AI will use to play against you.
- The game will display the Tic-Tac-Toe grid, where you can play as 'O' while the AI plays as 'X'.
- Try different algorithms and compare how the AI behaves!
-
Minimax Algorithm
The AI evaluates all possible moves and picks the optimal one to either win or force a draw. -
Alpha-Beta Pruning
A more efficient version of Minimax, which cuts off branches that don't need to be evaluated, speeding up the decision-making process. -
Heuristic-based Minimax
Introduces heuristics to guide the AI in making faster decisions, especially useful for larger game boards or when limited computational resources are available. -
Custom Strategy
A unique twist that introduces more variability and challenges to the gameplay. Test it out to see how it differs from the other strategies.
Feel free to contribute to this project by forking the repository and submitting pull requests. Contributions can include improvements to the algorithms, bug fixes, or adding new features to the game.
This project is licensed under the GPL License - see the LICENSE file for details.
If you have any questions, feedback, or collaboration ideas, feel free to reach out!
- GitHub: 3ab3z2
Enjoy playing Tic-Tac-Toe with AI! 🎮