Live Demo link: https://thestevendev.github.io/TicTacToe-AI/
This is a simple Tic-Tac-Toe game with an AI bot implemented in JavaScript. The bot uses the Minimax algorithm to make intelligent moves and plays against a human player.
To play the game, follow these steps:
- Open the
index.html
file in a web browser. - The game board will be displayed with empty cells.
- Click on an empty cell to make your move.
- The bot will automatically make its move.
- Continue taking turns until a player wins or the game ends in a tie.
- To start a new game, refresh the page.
The game is implemented using JavaScript, HTML, and CSS. The board is represented as an array, and the AI bot uses the Minimax algorithm to determine the best move. The winning combinations are checked after each move to determine if a player has won the game. The game interface is styled with basic CSS.
The project files are organized as follows:
index.html
: The main HTML file containing the game structure.style.css
: The CSS file for styling the game interface.script.js
: The JavaScript file containing the game logic and AI bot implementation.
This project is licensed under the MIT License. Feel free to use and modify it for your own purposes.