A fully functional Minesweeper game that can be deployed as a website, similar to Google's Minesweeper game.
✨ Game Features:
- Three difficulty levels: Easy, Medium, and Hard
- Classic Minesweeper gameplay
- Flag system to mark suspected mines
- Flood fill algorithm for automatic cell revelation
- Real-time timer and flag counter
- Game status indicator (Playing, Won, Game Over)
- Responsive design for mobile and desktop
| Difficulty | Grid Size | Mines |
|---|---|---|
| Easy | 8×8 | 10 |
| Medium | 12×12 | 30 |
| Hard | 16×16 | 99 |
- Click a cell to reveal it
- Right-click to place or remove a flag on a cell
- Numbers indicate how many mines are in adjacent cells
- Goal: Reveal all non-mine cells without hitting a mine
- The first click is always safe
- Left-click to reveal a cell
- Right-click to flag/unflag a cell
- Flagged cells cannot be revealed
- Empty cells (0 adjacent mines) auto-reveal adjacent cells
- Hitting a mine ends the game
- Revealing all non-mine cells wins the game
- Fork or clone this repository
- Connect your GitHub repository to Netlify
- Netlify will automatically deploy the site
- Your site will be live at a unique Netlify URL
- Go to repository Settings → Pages
- Select
mainbranch as the source - Your site will be available at
https://yourusername.github.io/miniHack
# Simply open index.html in your browser
open index.html
# Or use a local server
python -m http.server 8000
# Visit http://localhost:8000.
├── index.html # Main game HTML
├── styles.css # Game styling (Google-inspired)
├── script.js # Game logic and interactions
└── README.md # This file
- Chrome/Chromium
- Firefox
- Safari
- Edge
- Mobile browsers (iOS Safari, Chrome Mobile)
- HTML5 - Game structure
- CSS3 - Styling with Grid layout
- Vanilla JavaScript - Game logic (no dependencies)
- The first click determines safe zones
- Mines are placed after the first click to guarantee a winnable game
- Numbers are calculated based on adjacent mine positions
- When you click an empty cell (0 adjacent mines), adjacent cells are automatically revealed
- This continues recursively for all connected empty cells
- Reveal all non-mine cells
- A flag counter shows how many flags you can place
The game uses a clean, modern design inspired by Google's Minesweeper with:
- Google-like color scheme
- Smooth animations and transitions
- Responsive grid layout
- Mobile-friendly interface
- High score tracking (localStorage)
- Sound effects
- Leaderboard
- Custom difficulty settings
- Multiplayer mode
- Dark mode
MIT License - Feel free to use and modify this project!
Feel free to fork, modify, and submit pull requests to improve the game!