A* applied to minesweeper game

Started by
45 comments, last by Backward 10 years, 11 months ago

I was thinking about finding all possible combination for squares with number.

? ? ? ? ?
? ? 2 ? ?
? 2 2 1 1
? ? 1 0 0
? ? 1 0 0

In this example i will find all possible locations for every number. For example square 2 in second row.

? X ? ? ?
? X 2 ? ?
? 2 2 1 1
? ? 1 0 0
? ? 1 0 0

? ? X ? ?
? X 2 ? ?
? 2 2 1 1
? ? 1 0 0
? ? 1 0 0

? ? ? X ?
? X 2 ? ?
? 2 2 1 1
? ? 1 0 0
? ? 1 0 0

? ? ? ? ?
? X 2 X ?
? 2 2 1 1
? ? 1 0 0
? ? 1 0 0

? X X ? ?
? ? 2 ? ?
? 2 2 1 1
? ? 1 0 0
? ? 1 0 0

? X ? X ?
? ? 2 ? ?
? 2 2 1 1
? ? 1 0 0
? ? 1 0 0

? X ? ? ?
? ? 2 X ?
? 2 2 1 1
? ? 1 0 0
? ? 1 0 0

? ? X X ?
? ? 2 ? ?
? 2 2 1 1
? ? 1 0 0
? ? 1 0 0

? ? X ? ?
? ? 2 X ?
? 2 2 1 1
? ? 1 0 0
? ? 1 0 0

? ? ? X ?
? ? 2 X ?
? 2 2 1 1
? ? 1 0 0
? ? 1 0 0

There are 10 possible locations for mines around this square. If we find possible locations for all squares with number, then we can calculate probability without guessing and also we can be sure that all possible consistent combinations are found and here in your algorithm we do random distribution and we can't be sure for bigger tables that all consistent possibilities were computed.

Advertisement
You don't know if all those 10 distributions of two bombs around that "2" are equally likely or not.

You don't know if all those 10 distributions of two bombs around that "2" are equally likely or not.

What do you mean? I didn't understand you. If these 10 distributions are all possible for square "2", and if we find for rest of squares all possible distributions, we can make all combinations between all squares with numbers and only possible combinations will be found.

Oh, perhaps I didn't understand exactly what you proposed. Would you mind fleshing out your algorithm so I can understand better?

ok, look at those 10 combinations.

? B C D ?
? A 2 E ?
? 2 2 1 1
? ? 1 0 0
? ? 1 0 0

These 10 possibilities are: ab,ac,ad,ae,bc,bd,be,cd,ce,de. Now we can do same thing for rest of numbers and if we pair each possibility for each square with possibilities from another squares and do intersect, we will get all possible positions of mines and not mines. I was thinking about applying this algorithm first and then we can apply your algorithm. Maybe it can give better results.

The "pair each possibility for each square with possibilities from another squares and do intersect" part sounds ill defined to me. If you can describe an algorithm to do that, that would be great. Otherwise I can't tell if it would work without bias or not.

The "pair each possibility for each square with possibilities from another squares and do intersect" part sounds ill defined to me. If you can describe an algorithm to do that, that would be great. Otherwise I can't tell if it would work without bias or not.

Check your private messages.

This topic is closed to new replies.

Advertisement