Welcome to the Tic Tac Toe game project! This repository contains a simple yet fun implementation of the classic game, developed with HTML, CSS, and JavaScript. Players take turns marking a 3x3 grid with "X" or "O", aiming to get three in a row.
Tic Tac Toe is a classic game played on a 3x3 grid. Two players take turns marking a cell with "X" or "O", trying to get three in a row horizontally, vertically, or diagonally. If all cells are filled without a winner, the game is declared a draw.
- Interactive Gameplay: Clickable grid cells with hover effects for easy interaction.
- Win Detection: Automatic detection of winning combinations with visual highlights.
- Draw Handling: Proper handling of draw scenarios.
- Restart Button: A simple way to reset the game and start again.
To run this project locally, follow these steps:
- Clone the repository to your local machine: git clone https://github.com/ashitoshsable/tic_tac_toe-js.git
- Navigate to the project directory:
cd tic_tac_toe-js
To play the Tic Tac Toe game, open the index.html file in your preferred web browser:
- Click on a cell to make your move. The game alternates between "X" and "O".
- If a player gets three in a row (horizontally, vertically, or diagonally), that player wins.
- If the board is filled without a winner, it's a draw.
- Use the "Restart" button to reset the game and start over.
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with a descriptive message.
- Submit a pull request detailing your changes.