This project is a simple and interactive Tic Tac Toe Game built using HTML, CSS, and JavaScript. The game allows two players to take turns marking the spaces in a 3x3 grid. The first player to get three of their marks in a row (horizontally, vertically, or diagonally) wins the game.
- Two-Player Mode: Players take turns to place their marks (X or O) on the grid.
- Winning Logic: The game detects the winner once three marks are aligned, and it highlights the winning line.
- Draw Condition: If all the spaces are filled and no player wins, the game ends in a draw.
- Restart Game: Players can restart the game at any time by clicking the restart button.
- HTML: For structuring the game board and layout.
- CSS: For styling the board, marks, and other elements.
- JavaScript: To implement the game logic and interactivity.
- Clone the repository to your local machine:
- Open the
index.html
file in your web browser to start playing the game. - Click on any empty grid space to place your mark. The game will automatically switch turns between players.
- Click the "Restart" button to reset the game and play again.
git clone https://github.com/your-username/tic-tac-toe-game.git
.
├── index.html # Main HTML file
├── style.css # CSS for styling the game board and elements
└── script.js # JavaScript file for game logic and interactions
- Add an AI opponent for a single-player mode.
- Implement different difficulty levels for the AI.
- Include animations for a more dynamic game experience.