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

  • Thread starter weevil
  • Start date
  • Tags
    Derive
In summary, the conversation is about someone trying to program a minesweeper game and determining the maximum number of mines allowed on a board based on the number of rows and columns. They provide a list of numbers from the Windows version and discuss a possible equation for finding the maximum number of mines. They also mention the constraints for the maximum number of mines and the method used to find the numbers given. Lastly, they mention that they are attempting to reverse engineer the game and the numbers were obtained experimentally.
  • #1
weevil
3
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
  • #2
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.
 
  • #3
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.
 
  • #4
So basically you are trying to reverse engineer Minesweeper, and numbers you listed were checked experimentally?
 
  • #5
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.
 

1. How do I derive an equation?

To derive an equation, you will need to use the fundamental principles of mathematics and scientific principles related to the problem. Start by identifying the variables involved and their relationships. Then use algebra, calculus, or other mathematical techniques to manipulate the equations and solve for the desired variable. It may also be helpful to consult with other scientists or reference materials for guidance.

2. What are the steps to deriving an equation?

The steps to deriving an equation may vary depending on the specific problem, but generally, the process involves identifying the variables, determining the relationships between them, and using mathematical techniques to manipulate the equations and solve for the desired variable. It may also involve testing and refining the equation to ensure its accuracy and applicability.

3. Can I use existing equations to derive a new one?

Yes, you can use existing equations as a starting point for deriving a new one. However, it is important to make sure that the existing equations are relevant and applicable to your problem. You may need to modify or combine multiple equations to derive a new one that accurately represents the relationships between the variables in your specific scenario.

4. What if I am unable to derive an equation?

If you are unable to derive an equation, it may be helpful to consult with other scientists or experts in the field. They may be able to offer insights or alternative approaches to help you derive the equation. You may also need to gather more data or conduct further experiments to better understand the relationships between the variables.

5. How can I ensure the accuracy of my derived equation?

To ensure the accuracy of your derived equation, it is important to test and validate it using different methods and data sets. You may also want to compare it to existing equations or consult with other scientists for feedback. Additionally, it is important to clearly define the limitations and assumptions of your derived equation to ensure its applicability in different scenarios.

Similar threads

  • General Math
Replies
24
Views
2K
Replies
68
Views
9K
Replies
1
Views
2K
Replies
8
Views
2K
Replies
3
Views
2K
  • Introductory Physics Homework Help
Replies
10
Views
903
  • General Math
Replies
6
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
1K
  • General Math
Replies
2
Views
2K
Replies
22
Views
2K
Back
Top