A fun and interactive Tic Tac Toe game built with HTML, CSS, JavaScript, and Node.js!
- Interactive 3x3 Game Board: Click to place X and O
- Score Tracking: Keeps track of wins and draws
- Responsive Design: Works on desktop and mobile devices
- Win Detection: Automatically detects winning patterns
- Animations: Smooth animations and confetti effects on wins
- Game Controls: Reset game and reset score buttons
- Beautiful UI: Modern gradient design with hover effects
- Node.js (version 14 or higher)
- npm (comes with Node.js)
-
Navigate to the game directory:
cd tic-tac-toe -
Install dependencies:
npm install
-
Start the server:
npm start
-
Open your browser and visit:
http://localhost:3000
- The game starts with Player X
- Click on any empty cell to place your mark
- Players alternate turns (X and O)
- First player to get 3 in a row (horizontally, vertically, or diagonally) wins!
- If all cells are filled without a winner, it's a draw
- Use "Reset Game" to start a new game
- Use "Reset Score" to clear the scoreboard
For development with auto-reload:
npm run devtic-tac-toe/
├── index.html # Main HTML file
├── style.css # CSS styling
├── script.js # Game logic
├── server.js # Express server
├── package.json # Dependencies and scripts
└── README.md # This file
- Smart Win Detection: Checks all possible winning combinations
- Visual Feedback: Highlights winning cells with animations
- Score Persistence: Tracks wins and draws during the session
- Mobile Responsive: Optimized for all screen sizes
- Confetti Effect: Celebrates wins with animated confetti
- Smooth Animations: CSS transitions for better user experience
GET /- Main game pageGET /api/stats- Game statistics and informationGET /health- Health check endpoint
- Console logs with game instructions
- Confetti animation on wins
- Smooth hover effects on cells
- Gradient backgrounds and modern styling
- Responsive design for mobile play
MIT License - Feel free to modify and distribute!
Enjoy playing Tic Tac Toe! 🎉