Skip to content

ahmednasser111/tic-tac-toe-game

Repository files navigation

Tic-Tac-Toe Game

A simple, interactive Tic-Tac-Toe game built with React and Next.js.

Features

  • Play Tic-Tac-Toe against another player
  • Time travel: Go back to previous moves
  • Sort moves in ascending or descending order
  • Responsive design

Technologies Used

  • React
  • Next.js
  • TypeScript
  • CSS Modules

Getting Started

Prerequisites

  • Node.js (v14 or later)
  • npm or yarn

Installation

  1. Clone the repository:

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

    cd tic-tac-toe-game
    
  3. Install dependencies:

    npm install
    

    or

    yarn install
    
  4. Run the development server:

    npm run dev
    

    or

    yarn dev
    
  5. Open http://localhost:3000 in your browser to play the game.

How to Play

  1. The game starts with Player X. Click on any square to make a move.
  2. Players take turns to place their symbol (X or O) on the board.
  3. The first player to get three of their symbols in a row (horizontally, vertically, or diagonally) wins.
  4. If all squares are filled and no player has won, the game is a draw.

Additional Features

  • Time Travel: Use the buttons below the board to go back to any previous move.
  • Sort Moves: Click the "Sort Ascending/Descending" button to change the order of the move list.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

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

About

A simple, interactive Tic-Tac-Toe game built with React and Next.js.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published