A modern 4x4 Tic Tac Toe game with client-server architecture where the AI logic runs on the server.
- Client: HTML/CSS/JavaScript frontend that handles UI and user interactions
- Server: Node.js/Express backend that handles AI logic and game computations
cd server
npm installnpm start
# or for development with auto-reload:
npm run devThe server will run on http://localhost:3000
Open index.html in your browser, or serve it from the server at http://localhost:3000
- 4x4 Grid: Win by getting 4 in a row (horizontal, vertical, or diagonal)
- Smart AI: Computer player uses minimax algorithm with optimizations
- Server-Side AI: All computer logic runs on the backend
- Fallback Mode: Client falls back to random moves if server is unavailable
- Responsive Design: Works on desktop and mobile devices
- Visual Feedback: Animations, win highlighting, and status updates
POST /api/computer-move- Get the computer's next movePOST /api/check-game-state- Check current game stateGET /api/health- Server health check
- Player X (human) goes first
- Win by getting 4 symbols in a row, column, or diagonal
- Game ends in a tie if the board fills without a winner