Presentation is loading. Please wait.

Presentation is loading. Please wait.

Christopher Hodgson and Gregory Tyler Loftis

Similar presentations


Presentation on theme: "Christopher Hodgson and Gregory Tyler Loftis"— Presentation transcript:

1 Christopher Hodgson and Gregory Tyler Loftis
Winning Minesweeper Christopher Hodgson and Gregory Tyler Loftis

2 Minesweeper A minesweeper board consists of a grid x by y composed of either a value denoting the number of mines in cells adjacent to it, or a mine. Cells are hidden until probed. The player can mark a cell believed to be a mine. The game is won when all cells that are not mines are revealed. The game is lost if a mine is probed.

3 A Difficult Problem Deceptively hard game to win. Each game consists of only an X by Y grid, and N number of mines, randomly placed. Due to the nature of the game, there is no way to “backtrack” once a mistake is made. Probing a mine results in instant failure. Due to the random placement of the mines, it is difficult to isolate patterns from game to game, though there are patterns that do exist. For the purposes of our algorithms, we have a set of interactions that the program can take with the Minesweeper board: look, probe, mark, unmark.

4 Programmer’s Minesweeper and Strategies
Programmer’s Minesweeper is a program from Northeastern University designed to implement minesweeper strategies. It is open source and we are using it to analyze the algorithms and modifying it for our purposes. We discovered three strategies for approaching the game computationally: Single Point Strategy, Equation Strategy, and Constraint Satisfaction Problem Strategy (CSPStrategy).

5 Minesweeper Strategies
Strategies can be broken into to parts: What to do when you have enough data to work with What to do when you lack data The overall goal of a strategy is to win.

6 Single Point Strategy – A Naïve Approach
Three Rules: 1. If the number of mines adjacent to the square is equal to the value in the square, then all adjacent squares can be probed safely. 2. If the number of unknown adjacent squares + the number of marked adjacent squares is equal to the value in the square, then all unknown adjacent squares can be marked safely. 3. If the strategy cannot find either of these situations on the board, it probes a random square.

7 Single Point Strategy – A Naïve Approach
Rule 1: Rule 2 and 3:

8 Single Point Strategy – A Naïve Approach
Lowest win rate of examined strategies Required to make random probes: high probability that board winds up in a state where rule 3 is applied. Only works with known information and makes no logical inferences based on probability.

9 Equation Strategy Choose a starting point to add to probe set while game not won or you lose if probe set is empty choose an unprobed point to add probe set for all points in probe set apply single equation rule to point apply equation difference rule to point remove point from probe set if mines remaining < some number start comparing to global equation

10 Equation Off board = 0 Probed points = 0 Marked points = 1
Unprobed points = ? Mine Sweeper Board x 1 1 1 1 = x

11 Global Equation pValues are the values of the points that are unprobed when the limit is reached r is the number of mines remaining when the limit is reached

12 Single Equation Rule Mine Sweeper Board
If c for the point equals 0, then add all the points around it to the probe set. If c for the point equals the number of unmarked points, then mark all the points around it. x 1 1 2 2 1 2 = x 1 = x

13 Equation Difference Rule
Mine Sweeper Board Take the equation for a point and the equation of an adjacent point and subtract them If the value of the new c value equals the number of unknown points left, then mark them and probe the unprobed points that appear in both equations. x y 1 2 2 1 C2 C1 (2-1) = (x y ) – (x ) 1 = y

14 Choosing where to probe
Choose at random Choose base on probability of being a mine Use pattern matching to find mines where the strategy might fail.

15 Pattern Matching Mine Sweeper Board 1 2 2 1

16 Win Rates Minesweeper defines three difficulty levels
Beginner: 9 x 9 grid, 10 mines Intermediate: 16 x 16 grid, 40 mines Expert: 16 x 30 grid, 99 mines

17 Win Rates

18 Win Rates

19 Win Rates

20


Download ppt "Christopher Hodgson and Gregory Tyler Loftis"

Similar presentations


Ads by Google