What is the maximum number of mines in a Minesweeper board?

  • Context: Undergrad 
  • Thread starter Thread starter weevil
  • Start date Start date
  • Tags Tags
    Derive
Click For Summary

Discussion Overview

The discussion revolves around determining the maximum number of mines that can be placed on a Minesweeper board based on its dimensions (rows and columns). Participants explore mathematical relationships and constraints related to the game's mechanics, including the need for empty cells on the board.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant is attempting to derive an equation for the maximum number of mines based on empirical data from the Windows 7 version of Minesweeper.
  • Another participant questions the definition of "maximum number of mines" and suggests that if each cell can hold one mine, the maximum would simply be the product of the board's width and height.
  • It is noted that Minesweeper requires empty cells, implying that the maximum number of mines is less than the total number of cells on the board.
  • One participant confirms that the numbers provided were obtained experimentally from the game's custom board size dialog.

Areas of Agreement / Disagreement

Participants express differing views on the constraints surrounding the maximum number of mines, particularly regarding the necessity of empty cells. There is no consensus on a definitive equation or understanding of the maximum mine placement.

Contextual Notes

The discussion highlights the complexity of deriving a formula due to the game's requirements for empty cells, which are not explicitly quantified in the initial inquiry.

weevil
Messages
3
Reaction score
0
I'm programming a minesweeper game, and I'm trying to come up with an equation to determine the maximum number of mines a board can have dependent on the amount of rows and columns given. I pulled some numbers from the Windows 7 version, but I'm not sure how to derive an equation from them.

I'll list a few and maybe someone could point me in the right direction? Sorry if this is in the wrong forum, I'm lost enough in mathematics that I don't even know what branch this falls under :P

Row | Col | Windows Max No. of Mines
9 x 9 = 67
10 x 9 = 76
11 x 9 = 84
12 x 9 = 93

9 x 10 = 76
10 x 10 = 85
11 x 10 = 95
12 x 10 = 104

9 x 11 = 84
10 x 11 = 94
11 x 11 = 105
12 x 11 = 115

9 x 12 = 93
10 x 12 = 104
11 x 12 = 115
12 x 12 = 126

9 x 13 = 101
10 x 13 = 113
11 x 13 = 125
12 x 13 = 138

9 x 14 = 109
10 x 14 = 123
11 x 14 = 136
12 x 14 = 149

I found a crappy approximation as Row * Col - .9 * (14 + Col - 9 + Row - 9)
where any floating point number in the solution is truncated due to being
stored in an integer data type. It's serving for now but I'd like to understand how to analyze something like this for curiosities sake.
 
Mathematics news on Phys.org
Please explain what do you mean by "maximum number of mines" - what are constraints? Sounds to me like - if we assume each field can hold exactly one mine - maximum number of mines is just width*height of the board.
 
Borek said:
Please explain what do you mean by "maximum number of mines" - what are constraints? Sounds to me like - if we assume each field can hold exactly one mine - maximum number of mines is just width*height of the board.

Minesweeper needs empty cells on each new board. Windows gives a maximum number of mines you can have on any given board size, those are the numbers I gave above.
 
So basically you are trying to reverse engineer Minesweeper, and numbers you listed were checked experimentally?
 
Borek said:
So basically you are trying to reverse engineer Minesweeper, and numbers you listed were checked experimentally?

More or less :) The custom board size dialog gave those numbers as upper limits.
 

Similar threads

  • · Replies 24 ·
Replies
24
Views
3K
  • · Replies 68 ·
3
Replies
68
Views
12K
  • · Replies 3 ·
Replies
3
Views
934
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K