About this template
Minefield is an original, self-contained browser starter. It focuses on safe-first-click generation, neighbor counts, flood fill, and flags. The interface and game logic live in one HTML file, so you can open the source and trace the interaction from input to screen without setting up a toolchain.
How to play
Select a square to reveal it. Right-click to flag, or enable Flag mode before tapping. Reveal all 54 safe squares to win. Use the Start button to begin and Restart to try again. The game does not connect to a server or store a public score.
What is in the download?
The ZIP includes index.html, a quick-start README, and the MIT license. There are no external scripts, fonts, image assets, or package dependencies. Open index.html in a current browser to play; open it in a text editor to make changes.
Make your first change
Change MINES to tune the board, keeping enough cells outside the first-click safety area. Keep flood fill from opening flagged squares.
- Save a copy of the original before editing.
- Change one value or rule, reload, and play a full round.
- Try both winning and losing paths. Then check the controls on a smaller screen.
Ideas for your own version
Start with the visual theme: adjust the background, accent color, and title. Next, add a rule that changes a decision the player makes. Prefer one well-tested mechanic over several unfinished systems. Keep a short note beside each new setting so the next person can understand why it exists.
Read the neighboring numbers
Each revealed number counts mines in its eight surrounding squares, including diagonals. An empty square expands into neighboring safe space. The first reveal and its immediate neighbors are protected when mines are placed.
Use flags as working notes
Flags keep suspicious squares closed. On a phone, enable Flag mode, mark squares, then turn it off to reveal again. A flag is your guess, rather than proof that a mine is there. Reveal every safe square to win; placing ten flags alone does not complete the board. Some positions can require a guess.
Before you publish
This is a learning starter, not a full game engine. It has no network multiplayer, cloud saving, or commercial art pack. Add your own polish, test your target browsers, and follow the publishing checklist. The included code can be adapted for personal or commercial projects under the MIT license.