This is a simple implementation of the classic Tic-Tac-Toe game using HTML, CSS, and JavaScript. Players take turns to place 'X' and 'O' on a 3x3 grid, and the first player to align three of their marks in a row, column, or diagonal wins the game.
- Interactive 3x3 game board
- Player turns displayed with 'X' and 'O'
- Win detection for rows, columns, and diagonals
- Draw detection if the board is filled
- Reset button to start a new game
- Open
index.html
in a web browser. - Players take turns clicking on the empty cells to place their marks ('X' or 'O').
- The game checks for a winner after each move.
- If a player aligns three marks in a row, column, or diagonal, an alert will display the winner.
- If all cells are filled and no one wins, an alert will display that the game is a draw.
- Click the "Reset" button to clear the board and start a new game.
index.html
: Contains the HTML structure of the game.styles.css
: Contains the CSS for styling the game board and other elements.script.js
: Contains the JavaScript logic for handling player moves, checking for winners, and resetting the game.
To get a copy of the project up and running on your local machine, you can clone the repository with the following command:
git clone https://github.com/your-username/tic-tac-toe.git
Replace https://github.com/your-username/tic-tac-toe.git with your actual repository URL.
- Navigate to the project directory:
cd tic-tac-toe
- Open the index.html file in your web browser to play the game.
This project was developed to practice fundamental front-end development skills, including HTML, CSS, and JavaScript.
Enjoy playing Tic-Tac-Toe!