/tic-tac-toe

This is a simple implementation of the classic Tic-Tac-Toe game using HTML5, CSS3, and JavaScript. The game allows two players to take turns and compete against each other on a 3x3 grid. The objective is to get three of their symbols (either "X" or "O") in a row, column, or diagonal.

Primary LanguageJavaScriptMIT LicenseMIT

Tic-Tac-Toe Game

This is a simple implementation of the classic Tic-Tac-Toe game using HTML5, CSS3, and JavaScript. The game allows two players to take turns and compete against each other on a 3x3 grid. The objective is to get three of their symbols (either "X" or "O") in a row, column, or diagonal.

Features

  • Clean and intuitive user interface built with modern HTML5 and CSS3.
  • Interactive gameplay with visual feedback on player turns and game outcomes.
  • Two-player mode, allowing players to take turns on the same device.
  • Automatic detection of winning conditions and display of the winning player.
  • Restart functionality to reset the game board and start a new match.

Technologies Used

  • HTML5: Provides the structure and layout of the game interface.
  • CSS3: Adds visual styles and animations to enhance the user experience.
  • JavaScript: Implements the game logic and handles user interactions.

How to Play

  1. Open the game in a web browser that supports HTML5 and JavaScript.
  2. Two players sit at the same device, and Player 1 starts with the symbol "X."
  3. Players take turns clicking on an empty cell on the grid to place their symbol.
  4. The first player to get three of their symbols in a row, column, or diagonal wins the game.
  5. If all cells are filled, and no player has won, the game ends in a draw.
  6. Click the "Restart" button to reset the game board and start a new match.

Contribution

Feel free to contribute to the project by suggesting improvements or adding new features. To contribute, follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature: git checkout -b feature/your-feature-name.
  3. Commit your changes: git commit -m 'Add your feature'.
  4. Push to the branch: git push origin feature/your-feature-name.
  5. Open a pull request.

License

This project is licensed under the MIT License.

Acknowledgments

  • The tutorial by Programador BR provided a foundation for this implementation.

Enjoy playing Tic-Tac-Toe!