This is a simple web-based Tic-Tac-Toe game that includes an AI opponent using the Minimax algorithm. The AI is designed to be tough, making it hard to win for the player.
- Player vs AI Tic-Tac-Toe.
- The AI uses the Minimax algorithm to play optimally.
- Highlights winning cells and declares the winner or draw.
- AI aims to win as early as possible and delay losses.
- Player chooses to play as either X or O.
- The game board is a 3x3 grid.
- The first player to get three of their marks in a row (horizontally, vertically, or diagonally) wins the game.
- If all cells are filled and no player has won, the game is a draw.
- Choose your player (X or O).
- Take turns placing your mark on the grid.
- The AI will automatically make its move after yours.
- The game will declare a winner or draw once conditions are met.
-
Clone the repository:
git clone https://github.com/your-username/tic-tac-toe-ai.git cd tic-tac-toe-ai
-
Open the
index.html
file in your browser to play.
- Simply open the
index.html
in any browser. - You don't need any additional installations or dependencies.
This project is licensed under the MIT License. See the LICENSE
file for details.
Enjoy playing Tic-Tac-Toe with a tough AI opponent!