Comments on: How to Write your own Minesweeper AIhttps://luckytoilet.wordpress.com/2012/12/23/2125/
Notes on math, coding, and other stuffTue, 28 Jul 2015 18:41:36 +0000hourly1http://wordpress.com/By: Tatham Puzzle Collection: problem solving strategieshttps://luckytoilet.wordpress.com/2012/12/23/2125/#comment-52623
Mon, 08 Dec 2014 14:55:27 +0000http://luckytoilet.wordpress.com/?p=2125#comment-52623[…] an example to students, here is a link to a description of identifying the input an artificial intelligence would need for MineSweeper (the classic game numbers are revealed in a […]
]]>By: DanParkDeRockProject (@jongyon7192p)https://luckytoilet.wordpress.com/2012/12/23/2125/#comment-48229
Thu, 02 Oct 2014 23:37:25 +0000http://luckytoilet.wordpress.com/?p=2125#comment-48229It’s amazing how much work you put into this. Yes, the amount of mines left and the amount of mines adjacent to numbers do affect the probability of each combination. Now all combination are equally likely to happen.

Specifically, there are 13 squares adjacent to mines (this excludes the 3 squares on the top wall that are already proven to be mines) and the amount of mines in them range from 4 to 6 (again, excluding the top 3 mines). Let’s call the number ranging from 4 to 6 as “x”. Let’s define the amount of squares nonadjacent to numbers as “n”. We also don’t know the amount of remaining mines, so let’s call that “m”.

So, we must find all possible combinations of the “m-x” mines nonadjacent to the numbers, within the “n” squares nonadjacent to the numbers.

I personally use a Pascal’s triangle calculator and find the “m-x”th number in the “n”th row of the triangle (of course, including the 0th number and 0th row).

Once you get all 3 pascal numbers for all 3 possible numbers of x (4, 5, and 6), you have the probability of each combination depending on your x, the number of mines in the squares adjacent to the numbers.

P.S. Of course, this is assuming the numbers you’ve displayed were the only numbers that were on the board. If not, shit gets fucking ridiculously complicated. *shudder* I wouldn’t want to even think of that. I tried before. I’ve seen true terror.

]]>By: DanParkDeRockProject (@jongyon7192p)https://luckytoilet.wordpress.com/2012/12/23/2125/#comment-48227
Thu, 02 Oct 2014 23:14:29 +0000http://luckytoilet.wordpress.com/?p=2125#comment-48227I love the Probability section and it has been something I’ve been looking into for awhile now. But there’s another factor to truly making the best guess, and that is to pick the square that will give the most information. Or, hell, picking the square that is MOST LIKELY to give the most information.

To do this, two steps: the first step is to see what else would be found out for sure if you guessed a square and got it right. Second step is to figure all possible numbers that will appear on the square you picked and what probability each number will appear, and then finding what other squares can be found for sure with each resulting number.

In your Best Guess example, if you were to pick the “2” square on the middle of the right wall (oh god, I’m sorry. I really should have illustrations for this.), then you might get a 1, 2, 3, or 4. Obviously 2 or 3 is more likely, and either is more likely than the other depending on the mine density of the board. If you get 2, 3, or 4, you’re screwed and you have to make another guess. The same can be said for the “2” square on the middle of the bottom wall.

On the other hand, if you pick the “2” square on the lower part of the right wall, or the “2” on the bottom left corner (again, I’m sorry I don’t have illustrations), then you are sure to get some more information, and you’re more likely to get lucky with the numbers you might get. I don’t know if the lower square of the right wall or the bottom left corner square is the better guess, but they’re so clearly better than the other two “2” guesses.

I had to update the graphic detection routine when the next Windows version came out. I did not bother with the one after that.

That is not “AI”, though. There is no “self” intelligence in the program; it only makes the calculations that you have programmed into it.
It looks very intelligent to the outsiders … but that’s not what we call “real intelligence” :):)