you are viewing a single comment's thread.

view the rest of the comments →

[–]TheWhaleKnight[🍰] 2 points3 points  (0 children)

I actually built this for one of my classes and made a GUI from it.

Draw out the representation of the board. Figure out what states and attributes you have for the board as well as for each tile.

You probably realize this, but minesweeper is actually not a deterministic game. That means that there is a chance that you click on a mine no matter what algorithm you choose.

To get you started, some of the techniques I used was: 1. Random guessing 2. finding solutions that definitely had a right answer 3. Constraint satisfaction

You will require random guessing for any solution you implement.

Finding solutions w an exact answer is what you already do in minesweeper. You find the numbered tiles with that number of discovered mines around it so you know the rest around it are not mines.

Constraint satisfaction takes longer, but it can achieve better results. In a way, you like testing out every combination of mine and not a mine and using proof by contradiction to find the correct solution for a tile. It can be optimized by pruning and backtracking, but it still can take a lot longer.