A simple and interactive Tic Tac Toe game implemented using HTML, CSS, and JavaScript. This game allows two players to take turns playing the classic Tic Tac Toe game, with functionality to detect wins, draws, and restart the game.
- Two-player gameplay: Players take turns clicking on boxes to place "X" or "O" on the grid.
- Win and Draw detection: The game detects when a player wins or when the game ends in a draw.
- Popup message: Displays a winning message or a draw notification when the game ends.
- Restart functionality: Allows players to restart the game without reloading the page.
You can play the game directly from the live link:
Play Tic Tac Toe
- Click the "Play Tic Tac Toe" link given above, the game will be open in your browser.
- The game board will display a 3x3 grid of boxes.
- Player 1 will use "X" and Player 2 will use "O".
- Players take turns by clicking on any empty box.
- The game ends when one player wins or when all spots are filled (a draw).
- To start a new game, click the Restart button below the game grid.
To run this project locally:
-
Clone this repository:
git clone https://github.com/vishalshukla6395/tic-tac-toe.git
-
Navigate to the project directory:
cd tic-tac-toe
-
Open the
index.html
file in your browser to play the game.
- HTML: Used for structuring the web page.
- CSS: Used for styling the game board and layout.
- JavaScript: Used for implementing game logic and interactivity.