A modern, responsive web-based implementation of the classic Dots and Boxes game with a beautiful glassmorphism design and smooth animations.
- Multiple Board Sizes: Choose from 3×3 (Small), 5×5 (Medium), 8×8 (Large), or create custom dimensions up to 20×20
- Two Game Modes:
- Player vs Player (local multiplayer)
- Player vs Computer (with intelligent AI)
- Custom Player Names: Personalize your gaming experience
- Responsive Design: Works seamlessly on desktop, tablet, and mobile devices
- Modern UI: Glassmorphism design with smooth animations and visual effects
- Real-time Scoring: Live score tracking with turn indicators
- Game Statistics: Post-game leaderboard showing final results
- Setup: Enter player names and select your preferred board size and game mode
- Gameplay: Click on the dashed lines between dots to draw them
- Scoring: Complete a box (all 4 sides) to claim it and earn a point
- Bonus Turns: Completing a box grants you an additional turn
- Victory: The player with the most completed boxes wins!
- A modern web browser (Chrome, Firefox, Safari, Edge)
- No additional software installation required
- Clone the repository:
git clone https://github.com/r3dhulk/dots-and-boxes.git
- Navigate to the project directory:
cd dots-and-boxes
- Open
index.html
in your web browser
Simply download the index.html
file and open it in any modern web browser - no server setup required!
- Glassmorphism UI: Modern frosted glass effect with backdrop blur
- Gradient Backgrounds: Beautiful color transitions
- Smooth Animations: Hover effects and transitions for better UX
- Responsive Layout: Adapts to all screen sizes
- Visual Feedback: Clear indicators for player turns and completed boxes
- Accessibility: High contrast and touch-friendly interface
The computer opponent uses an intelligent strategy:
- Offensive Play: Prioritizes completing boxes when possible
- Defensive Play: Avoids moves that would give the opponent easy box completions
- Random Fallback: Makes random safe moves when no strategic advantage is clear
- Touch-optimized interface
- Responsive grid scaling
- Finger-friendly touch targets
- Optimized font sizes and spacing
- Landscape and portrait orientation support
- Pure HTML/CSS/JavaScript: No external dependencies
- ES6 Classes: Modern JavaScript architecture
- CSS Grid & Flexbox: Responsive layout system
- CSS Custom Properties: Easy theming and customization
- Event-driven Architecture: Clean separation of game logic and UI
- Players take turns drawing lines between adjacent dots
- When a player completes the fourth side of a square, they:
- Claim that box (marked with their initial)
- Earn one point
- Get another turn immediately
- The game ends when all possible lines are drawn
- The player with the most completed boxes wins
The game supports various customization options:
- Board Size: From 2×2 up to 20×20 grids
- Player Names: Custom names for personalized experience
- Visual Themes: Easy to modify CSS variables for different color schemes
- Online multiplayer support
- AI difficulty levels
- Game replay system
- Sound effects and music
- Tournament mode
- Statistics tracking
- Theme customization
- Undo/Redo functionality
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Early Game: Focus on the center of the board
- Mid Game: Watch for chain reactions where completing one box leads to many more
- End Game: Count carefully and look for sacrifice moves
- Against AI: The computer is aggressive about completing boxes, so set up defensive positions
- None currently reported. Please open an issue if you find any bugs.
If you enjoy this game, please consider:
- Starring the repository
- Sharing it with friends
- Contributing improvements
- Reporting bugs or suggesting features
Made with ❤️ for classic game enthusiasts