Header Banner
WonderHowTo Logo
WonderHowTo
PC Games
wonderhowto.mark.png
Gadget Hacks Next Reality Food Hacks Null Byte The Secret Yumiverse Invisiverse Macgyverisms Mind Hacks Mad Science Lock Picking Driverless
Home
PC Games

Stop Blowing Yourself Up! Use This DIY Mine-Detecting Program to Beat Minesweeper

Jan 11, 2013 09:42 PM
Minesweeper game grid with number clues.

Minesweeper is one of those games that everyone plays, but hardly anyone actually knows how to play. Most people just click random squares and see how far they can get.

If you don't want to take the time to learn how it works, but still hate losing, computer science student Bai Li has just the program for you. He wrote an AI that can scan the Minesweeper board, run calculations, and figure out where the mines are.

It wins about 50% of the time, which is probably higher than most people's record. It uses several different algorithms to evaluate the probability that each square contains a mine.

The first two simpler algorithms had much lower success rates, but when Li utilized the mine counter, the solver was much more accurate. Finally, a Java script uses the Robot class to make the mouse click in order to play.

You can find a detailed writeup and explanation of the algorithm over on Li's blog, along with some general tips and tricks to beating Minesweeper, and he's posted all of the code over on Github.

If you don't have a Windows system that comes with Minesweeper already installed, you can download it free for both Windows 8 and Mac. Or, if you just want to play on your phone, it's available on Google Play and iOS as well.

You already know how to use your phone. With Gadget Hacks' newsletter, we'll show you how to master it. Each week, we explore features, hidden tools, and advanced settings that give you more control over iOS and Android than most users even know exists.

Sign up for Gadget Hacks Weekly and start unlocking your phone's full potential.

Related Articles

Comments

No Comments Exist

Be the first, drop a comment!