TicBot is a web-based Tic-Tac-Toe game where you can play against an AI opponent. The AI uses the Minimax algorithm to make optimal moves, ensuring a challenging game for the player.
TicBot is built using Flask for the backend and HTML/CSS for the frontend. The game logic, including the AI opponent, is implemented in Python. The AI uses the Minimax algorithm to evaluate the best possible moves, making it a formidable opponent.
- Human vs AI: Play against the computer.
- Minimax Algorithm: The AI uses the Minimax algorithm to make optimal moves.
- Score Tracking: Keeps track of wins for both the human and the computer.
- Reset Functionality: Reset the game board at any time.
- Human Move: The human player makes a move by clicking on the desired cell.
- AI Move: The AI calculates the best move using the Minimax algorithm and makes its move.
- Win Check: After each move, the game checks if there is a winner.
- Score Update: The scores are updated based on the game outcome.
- Reset: The game can be reset to start a new match.
Here is an example of the game interface:
- Python 3.x
- Flask
-
Clone the repository:
git clone https://github.com/noth3m/TicBot cd ticbot
-
Install the required packages:
pip install -r requirements.txt
-
Run the application:
python app.py
-
Open your web browser and navigate to
http://127.0.0.1:5000/
to start playing.
app.py
: Main application file.templates/index.html
: HTML template for the game interface.tictactoe.py
: Contains the game logic and Minimax algorithm.
Contributions are welcome! Please fork the repository and create a pull request with your changes.
This project is licensed under the MIT License. See the LICENSE file for details.
- Flask - Web framework used.
- Minimax Algorithm - Algorithm used for AI decision making.