Welcome to the TIC-TAC-TOE game! This is an interactive and simple implementation of the classic game with an option to play against another player or challenge an AI opponent. The game is developed using JavaScript for the frontend, providing an exciting experience whether you're playing solo or with a friend.
- Player vs Player: Play with another human player on the same device.
- Player vs AI: Play against an AI opponent with random moves.
- Interactive UI: Beautiful and user-friendly interface for an engaging experience.
- Game Mode Selection: Choose between single-player or two-player mode.
- Reset Functionality: Reset the game board at any time.
- Frontend Language: JavaScript, HTML, CSS
- Backend Language: Python
- Backend Framework: Flask
- AI Algorithm: Minimax Algorithm (random move selection)
To run the game locally, follow these steps:
-
Clone the repository:
git clone https://github.com/KunalSingh5431/TIC-TAC-TOE.git cd TIC-TAC-TOE
-
Open the game: Open
index.html
in any browser to play the game. No additional installations are required.
-
Game Modes:
- Player vs Player: Two players take turns to place their marks (X or O) on the board.
- Player vs AI: Player 1 (X) competes against the AI (O). The AI selects random moves.
-
Gameplay:
- The game is played on a 3x3 grid.
- Player 1 is X and Player 2 (or the AI) is O. Players take turns marking empty squares.
- The first player to align 3 marks in a row (up, down, across, or diagonally) wins.
- If all squares are filled and no player wins, it’s a draw.
-
Starting the Game:
- Select the game mode: Player vs Player or Player vs AI.
- Enter player names (if playing Player vs Player).
- Press the "Start Game" button to begin.
-
Resetting the Game:
- Use the "Reset Board" button to reset the board for a new game.
The AI opponent in single-player mode uses random moves to make its decisions. While basic, it provides a challenging opponent for casual gameplay.
Contributions are welcome! If you have any improvements or suggestions, feel free to fork the repository and create a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or feedback, feel free to reach out:
- Email: [email protected]
Enjoy playing TIC-TAC-TOE with AI! 🛩️