Skip to content

manfredwern/tic-tac-toe

Repository files navigation

Tic-Tac-Toe Game

This is a simple Tic-Tac-Toe game implemented using vanilla JavaScript and bundled with Vite.

Features

  • Play Tic-Tac-Toe against a friend.
  • Simple and intuitive user interface.
  • Ability to undo moves during gameplay.

Tech Stack

  • JavaScript: Implemented the game logic using vanilla JavaScript to handle player moves, determine win conditions, and manage game state.
  • Vite: Used Vite as a bundler to build and bundle the project files, optimizing performance and facilitating development with fast hot module replacement.

Getting Started

To run the Tic-Tac-Toe game locally, follow these steps:

  1. Clone the repository:

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

    cd tic-tac-toe
  3. Install dependencies:

    npm install
  4. Start the development server:

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

Usage

  • Click on an empty cell to place your move (X or O).
  • The game will automatically switch turns between players.
  • The first player to get three of their symbols in a row (horizontally, vertically, or diagonally) wins the game.
  • If all cells are filled without a winner, the game ends in a draw.
  • Use the "Undo" button to revert the last move.
  • Use the "New Game" button to start a new game.

This Tic-Tac-Toe game is created by manfredwern for demonstration and educational purposes.

About

Make use of JavaScript to build a tit-tac-toe game

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published