A simple Tic Tac Toe game built with React and Vite.
Two players take turns placing their marks (X or O) on a 3×3 grid. The first player to align three of their marks horizontally, vertically, or diagonally wins.
If all squares are filled without a winner, the game ends in a draw.
This version includes a move log to track each turn, but does not have an undo feature.
- Interactive 3×3 game board
- Alternating turns between X and O
- Automatic win and draw detection
- Move log showing each turn’s position
- Restart button to reset the game
- React 18
- Vite
- JavaScript
- HTML / CSS
git clone https://github.com/Manyanggg/Tic-Tac-Toe-Game.git
cd Tic-Tac-Toe-Game
2) Install dependencies
npm install
3) Start the development server
npm run dev
Vite will output a local development URL (usually http://localhost:5173).
4) Build for production
npm run build
5) Preview the production build
npm run preview
🕹️ How to Play
X always starts the game.
Players take turns clicking an empty square to place their mark.
The game announces a winner when three marks are aligned horizontally, vertically, or diagonally.
If all squares are filled without a winner, it’s a draw.
The Move Log shows the history of each turn in order.