Minesweeper is unpredictable and relentless, and that's because at its core it's a game of luck. More than once, players are forced to escape a '50/50 trap' by clicking on a block with no additional information, risking long games in the process. So, how would an artificial intelligence fare? The person behind the Code Bullet channel decided to take on the challenge and create an AI with the sole goal of beating Minesweeper. Despite some inauspicious beginnings... it crushes it.
The 50/50 Trap
Few things are as irritating as reaching the last move in a Minesweeper game and discovering it's a classic "red wire - blue wire" situation. Fifty percent odds: if you're wrong, you lose, and all your previous effort counts for nothing. Of course, that's not enough to stop us from returning to the game for revenge, and every time the happy face puts on its sunglasses, the satisfaction is enormous. Now, a frequent question is how one manages to play a perfect game when the game manipulates the board's content. After all, classic Minesweeper ensures you can't lose on the first turn (if there's a mine behind the first clicked block, it moves to the upper left corner of the board).
How the AI Works
That's where an artificial intelligence comes in, capable of reproducing all the basic logical rules of Minesweeper while also applying a bit of probability, so it always clicks the block with the lowest chance of blowing up. The difference between this AI and others is that it was written line by line. No neural networks or training here, so... I'm not sure how appropriate it is to call it "artificial intelligence". Obviously, when its creator on the Code Bullet channel says it's a perfect player, he really means it doesn't make mistakes when clicking one block or another (how many times has that happened to us?), its eyes don't tire, and it's very fast.
Impressions and Limits
Personally, I must admit that its solution of the 64 x 36 board is impressive, and in the second video it smashes the world speed record. The only thing that really complicates life for this AI is increasing the number of mines without changing the board size. For the rest of us mortals, there's always the 'xyzzy' shortcut...