Want to make creations as awesome as this one?

Transcript

da Silva, Isabela - 2022

Solving Minesweeper with Artificial Intelligence

How to play Minesweeper

Straightforward Algorithm

  • The Begginer's grid is 10x10;
  • You should click on the middle and than analyze the numbers to identify where the mines are;
  • When you are sure of their positions, you mark the places with a flag;
  • Finally, you click on the places you know that are not mines and keep repeting the process.

How the AI is going to play

The Tank Solver Algorithm

  • The idea for the Tank algorithm is to enumerate all possible configurations of mines for a position, and see what’s in common between these configurations.

The Tank Solver Algorithm

  • To implement the Tank algorithm, we make a list of border tiles: all the tiles we aren’t sure about but have some partial information.
  • If we made the AI look at all the board, it would probably solve this after some time, but that wouldn't be efficient.

The probability problem

  • One of the two squares has a mine. It could be in either, with equal probability, so it's a 50-50 chance.
  • The Tank Solver fails it and the only choice left is to calculate the best guess possible by probability.

How the AI itself will be done

  • Read the board.
Using a screenshot function, we can get a bitmap of all the pixels on the board, and than we can read the numbers on the screen. And also, the numbers have different colors: 1 is blue, 2 is green, 3 is red, and so on.
  • Calculate the data
Run the calculations of the spaces that have or don't have mines and generate the list for analysis.
  • Click the board
Using Java, there is a standard library names Robot Class that we can use to send the mouse to a certain place of the screen and click with the left or right part to mark a bomb or to show more numbers.
<https://dev.to/krlove/creating-advanced-minesweeper-solver-using-logic-programming-2ppd> Accessed on 13/04/2022<https://luckytoilet.wordpress.com/2012/12/23/2125/> Accessed on 13/04/2022<https://github.com/arcs-/Minesweeper-Solver> Acessed on 13/04/2022

Bibliography