• FEATURED

View more

View more

View more

Image of the Day Submit

IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

A* applied to minesweeper game

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

46 replies to this topic

#41Backward  Members

Posted 09 May 2013 - 03:15 PM

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.

#42Álvaro  Members

Posted 09 May 2013 - 08:45 PM

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

#43Backward  Members

Posted 09 May 2013 - 11:01 PM

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.

#44Álvaro  Members

Posted 10 May 2013 - 07:40 AM

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

#45Backward  Members

Posted 10 May 2013 - 08:42 AM

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.

#46Álvaro  Members

Posted 10 May 2013 - 08:57 AM

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.

#47Backward  Members

Posted 13 May 2013 - 09:09 AM

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.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.