Skip to content

Mazenmarwan023/tic-tac-toe-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic-Tac-Toe-react (XO Game)

A simple Tic-Tac-Toe game built with React.js. The game allows two players to select either "X" or "O", enter their names, and play against each other on a 3x3 grid. The game keeps track of each player's moves and displays a message when a player wins, loses, or the game ends in a draw.

Features

  • Players can select their symbol ("X" or "O") and enter their names.
  • The game board updates in real-time as players choose their moves.
  • A list below the grid shows each move made by the players, including the row and column of the selected cell.
  • A pop-up message appears to announce the result when a player wins, loses, or when the game ends in a draw.

Screenshots

Here are some screenshots of the Tic-Tac-Toe game interface:

Screenshot 2025-01-07 at 5 42 49 PM Screenshot 2025-01-07 at 5 43 15 PM Screenshot 2025-01-07 at 5 43 46 PM Screenshot 2025-01-07 at 5 46 15 PM Screenshot 2025-01-07 at 5 44 42 PM

Usage

  1. Enter your name in the provided text box.
  2. Select either "X" or "O" as your symbol.
  3. Take turns with your opponent to select cells on the grid.
  4. Watch the list below the grid for updates on each move.
  5. A pop-up will appear to announce the winner, or if the game ends in a draw.

Installation

  1. Clone the repository:

    git clone https://github.com/Mazenmarwan023/tic-tac-toe-react.git
  2. Navigate to the project directory:

    cd tic-tac-toe-react
  3. Install the dependencies:

    npm install
  4. Run the development server:

    npm run dev
  5. Open your browser and go to http://localhost:3000 to play the game.

Technologies Used

  • React.js
  • Vite
  • JavaScript (ES6+)
  • CSS

License

This project is open-source and available under the MIT License.


About

A simple Tic-Tac-Toe game built with React.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published