Project Nayuki

Automatic Minesweeper solver

Conceding that I’m not going to be the fastest or best gamer, I instead chose to exercise my programming skills. I wrote a Java program that plays the Windows Minesweeper game automatically – it reads the screen, computes the moves to make, and performs the mouse movements, all at superhuman speed and accuracy.

Everyone has been exposed to video games at some point in their lives. Although I’m not too bad of a gamer, for every game I played, I’ve seen plenty of players who are much better than myself. I don’t think I have the time or talent to bring myself to the top of the rankings. However, with some unique skills as a programmer, I can design computer programs to play games for me with incredible efficiency.

I’ve wasted my fair share of time on the classic Minesweeper game that’s bundled with Microsoft Windows. But all this time, I was never able to solve the expert difficulty level, either because my logic was insufficient or there were too many ambiguities. This was one of my motivations for writing the solver bot, and it finally did solve the expert level.


Source code only:

Complete package: (source code, compiled classes, bitmaps)

After unzipping, run on the command line with: java MinesweeperAutosolver

Ensure that a Minesweeper window is visible on the screen before running the autosolver. The program will exit if you move the mouse.


More info