Why your first click in Minefield is always safe
In the earliest versions of minesweeper the very first click could be a mine, and with nothing revealed there was no information to avoid it. That is a coin flip, not a puzzle. Minefield avoids this by not placing the mines until you click for the first time.
The board is empty until you click
When a round starts, the grid contains no mines. Your first reveal triggers the placement. That is also the moment the timer starts, so the clock runs from your first click and not from when the board appears.
The safe zone
When mines are placed, the cell you clicked and all of its neighbors are excluded from the possible positions. In the middle of the board that is 9 cells, on an edge 6 and in a corner 4. Because none of the neighbors can hold a mine, your first cell always shows no number, and the game automatically opens the connected empty area around it. You never start from a single lonely cell. A click in the middle usually opens a larger area than one in a corner, since it has more neighbors that can open further.
A fair shuffle
All cells outside the safe zone are collected in a list, shuffled and the first few become mines. The shuffle is a Fisher-Yates shuffle, which gives every arrangement the same chance. We avoided the common shortcut of sorting a list with a random comparison, which looks random but is known to favor some arrangements.
There is also a fallback. If the safe zone ever left fewer free cells than mines, only the clicked cell would be protected. With the current board sizes this never happens, but it keeps the game correct if the sizes change.
Board sizes and difficulty
- Easy: 8 by 8 with 8 mines (12.5 percent of cells), 56 safe cells
- Medium: 10 by 10 with 16 mines (16 percent), 84 safe cells
- Hard: 12 by 12 with 30 mines (about 21 percent), 114 safe cells
The higher mine density on hard means that fewer cells can be solved with simple counting, and more situations need real deduction.
Numbers, flags and chording
Each number tells you how many of the eight surrounding cells contain a mine. Once you have placed as many flags around a revealed number as the number itself, tapping that number opens all of its remaining neighbors at once. This is called chording. It is fast, but if one of your flags is wrong, you will open a mine. Flagged cells are never opened by a normal reveal, which protects you from clicking one by accident.
Scoring
You earn 10 points for every safe cell you reveal. Clearing the whole board adds a 500 point bonus and 5 points for every second under the par time (90 seconds on easy, 180 on medium and 360 on hard). The total is multiplied by 1 on easy, 1.5 on medium and 2.5 on hard. If you hit a mine, you keep the points for the cells you opened before that.