/tic-tac-toe

Primary LanguageJavaScript

Tic-Tac-Toe Game


This is a simple Tic-Tac-Toe game built using HTML, CSS, and JavaScript. It allows two players to take turns and compete against each other until one of them wins or the game ends in a draw.

Preview

(https://github.com/Chusman3057/tic-tac-toe/blob/main/tic-tac-toe.png)

How to Play

  1. Clone or download this repository to your local machine.
  2. Open the index.html file in your web browser.
  3. The game board will be displayed, and the first player can start by clicking on an empty cell.
  4. Players take turns to place their symbol (X or O) on the board by clicking on an empty cell.
  5. The game will automatically check for a win or draw after each move and display the result.
  6. To restart the game at any point, click the "Restart" button.

Features

  • Responsive design: The game adapts to different screen sizes, making it playable on both desktop and mobile devices.
  • Win detection: The game automatically detects winning combinations and highlights the winning cells.
  • Draw detection: If all cells are filled, and no player wins, the game will end in a draw.
  • Reset: Players can restart the game at any time by clicking the "Restart" button.

Technologies Used

  • HTML5: Markup structure for the game board.
  • CSS3: Styling and layout of the game interface.
  • JavaScript: Game logic and interactivity.

How to Contribute

    If you'd like to contribute to this project, you can follow these steps:

  • Fork the repository.
  • Create a new branch for your feature or bug fix.
  • Make your changes and test them thoroughly.
  • Submit a pull request explaining the changes you've made.