I created a PERFECT minesweeper AI
Video Statistics and Information
Channel: Code Bullet
Views: 6,926,068
Rating: undefined out of 5
Keywords: Math, AI, artificial intelligence, programming, java, computer science, games, minesweeper, perfect
Id: cGUHehFGqBc
Channel Id: undefined
Length: 7min 46sec (466 seconds)
Published: Fri Apr 13 2018
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.
Is this really considered AI? As best I can tell, it didn't really learn how to play the game, it was just a "reverse" or puzzle solver.
Nice, I wrote a similar program for a job application. https://rdsilver.github.io/minesweeper/ Didn't get the job :(
Did you actually use windows minesweeper, use screenshots to read the state of the board, and automate mouse movements? That would be wild.
I'm not sure this is 'perfect'.
Using a totally random position for the first move seems like it's sub-optimal. If the random choice is on an edge, then it will reveal less useful information since it's only showing information about 6 tiles rather than 9. A corner would be even worse at 4.
It would also seems to me that the distance to the edge (or previously revealed pieces) could also effect the game since you could be getting more information if you hit one of the 'open areas' that reveal a heap of the board in one go. An open area against an edge, or known bomb area isn't going to grow as far.
I suppose a lot will depend on if the fitness metric is win vs loose % or includes the number of moves to win.
EDIT: Actually since it's chance, the fewer moves made should increase the chance of winning unless a move is a sure thing.
I personally wouldn't consider this AI because the vast majority is strictly rule-based. There's essentially only 1 valid solution given the available percepts.
This is an algorithm, not an AI. And it's not perfect, it doesn't have a color-gradient overlay showing all the probabilties like mine does :P Play with mine here. Double click the file to start. Hold down enter to auto-play. It's also faster.