Skip to content

Latest commit

 

History

History
61 lines (31 loc) · 2.39 KB

README.md

File metadata and controls

61 lines (31 loc) · 2.39 KB

TIC-TAC-TOE

Tic Tac Toe Game

The Tic Tac Toe game is a classic two-player game played on a 3x3 grid. The objective of the game is to be the first player to form a horizontal, vertical, or diagonal line with their respective symbol (usually 'X' or 'O').

Features

  • Interactive Gameplay: The game provides an interactive interface where two players can take turns making their moves.

  • Player Turns: The game alternates between the players, allowing each player to place their symbol on an empty cell of the grid.

  • Win Detection: The game detects and declares a winner when a player successfully forms a line of their symbols.

  • Draw Detection: If all cells are filled and no player has formed a line, the game recognizes a draw and ends the game.

  • Restart Option: After the game ends, players have the option to restart and play again.

Installation

To play the Tic Tac Toe game, follow these steps:

  1. Clone the repository: git clone https://github.com/abokmadaki/tic-tac-toe.git

  2. Open the game folder: cd tic-tac-toe

  3. Open the game in a web browser: index.html

  4. Play the game by clicking on the cells of the grid to place your symbols and follow the game rules.

Usage

  1. Start the Game: Open the game in a web browser by opening index.html.

  2. Player Turns: The game will prompt the first player to make a move. Click on an empty cell in the grid to place your symbol ('X' or 'O').

  3. Win Detection: The game will automatically detect when a player forms a line with their symbols horizontally, vertically, or diagonally. The game will display a message declaring the winner.

  4. Draw Detection: If all cells are filled and no player forms a line, the game will declare a draw.

  5. Restart the Game: After the game ends, players have the option to restart and play again by clicking on a restart button or refreshing the web page.

Contributing

Contributions are welcome! If you want to contribute to the Tic Tac Toe game, please follow these steps:

  1. Fork the repository.

  2. Create a new branch: git checkout -b feature/new-feature.

  3. Make your changes and commit them: git commit -m 'Add new feature'.

  4. Push to the branch: git push origin feature/new-feature.

  5. Open a pull request on GitHub.

Please ensure that your code follows the project's coding conventions and includes appropriate documentation.

License

This project is licensed under the MIT License.