This is a simple Tic-Tac-Toe game implemented using vanilla JavaScript and bundled with Vite.
- Play Tic-Tac-Toe against a friend.
- Simple and intuitive user interface.
- Ability to undo moves during gameplay.
- 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.
To run the Tic-Tac-Toe game locally, follow these steps:
-
Clone the repository:
git clone https://github.com/manfredwern/tic-tac-toe.git
-
Navigate to the project directory:
cd tic-tac-toe
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open your browser and visit
http://localhost:5173
to play the game.
- 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.