Welcome to the MCTS-Tic-Tac-Toe project! This is a web-based application where you can play Tic-Tac-Toe against an AI opponent that uses the Monte Carlo Tree Search (MCTS) algorithm. The AI performs multiple simulations to select the best possible move, giving you a challenging game.
- Play Tic-Tac-Toe interactively through your browser.
- AI opponent powered by Monte Carlo Tree Search.
- Streamlit-based web interface.
- Real-time move evaluation and visualization.
The AI uses the Monte Carlo Tree Search (MCTS) algorithm to play Tic-Tac-Toe. It performs the following steps for each move:
- Simulate: Randomly plays out multiple games from the current game state.
- Evaluate: Each simulation is evaluated to see which move leads to the best outcome.
- Accumulate: Scores are accumulated for each possible move.
- Select: The move with the highest score is chosen as the AI's next move.
- Python: Game logic and AI implementation.
- Streamlit: For building the web interface.
- Monte Carlo Tree Search: Used for AI decision-making.
- Clone the repository:
git clone https://github.com/PhenomSG/MCTS-Tic-Tac-Toe.git
- Navigate to the project directory:
cd MCTS-Tic-Tac-Toe
- Install the required dependencies:
pip install streamlit
- Run the application:
streamlit run tic_tac_toe_app.py
- After launching the application, you will be presented with a 3x3 Tic-Tac-Toe board.
- You play as Player O. Click on any empty cell to make your move.
- The AI, playing as Player X, will make its move after yours.
- Continue playing until one player wins or the game ends in a draw.
- Adding difficulty levels by adjusting the number of simulations.
- Implementing a larger board or different game variations.
- Adding a more sophisticated evaluation function for MCTS.
This project is licensed under the MIT License