Minehunt: a Sample Game


We use the 13x8 board.


Obviously, our very first move must be a random click:  we have no information whatsoever!  I started out by clicking the cell marked with a red dot.

Fortunately, this uncovered a cell with no bombs around it.

In such a case the program will help me:  if the cell I clicked on has zero bombs around it, then obviously I can safely click all of those surrounding cells to uncover them:  none contain a bomb that will kill me.  I can go on in this fashion until I have uncovered a "sea" of cells such that at the "shores" I have cells that do have a bomb somewhere close and I dare not continue.  To save me the tedious work of clicking on all those safe cells, the program will do the expansion of the sea from the zero-bomb cell automatically for me.  Thus after my lucky first click I see a sea of uncovered cells.

Since we will discuss the game in quite some detail, I will use a coordinate system to refer to cells:  I have numbered the rows 1 to 8 and the columns A to M.  The cell I clicked on is G6.
Immediately to the left of cell G6 is F6, a cell with a "1" in it:  that means it has just one bomb in its surrounding cells.  I highlighted its surrounding 8 cells in faint yellow.  There is only one bomb in the eight cells E5, F5, G5, E6, G6, E7, F7, G7 around G6.  But I also notice that in fact there is only one covered cell: E5, the only place where that one bomb can hide.
So I can be certain that that must be a bomb and I can mark it with a flag (which in this version of the game is done by option-clicking the cell which then becomes a dull red):
There are two other cells showing a "1" and at the same time having only one covered cell in their surroundings:  J4 and H8.  I can mark those too with a flag, knowing that there must be a bomb under that cell:
Great.  We have located 3 of the 20 bombs with mathematical certainty.  Consider E6, just under the first bomb we located:  it too bears a "1".
E5 must be the bomb that E6 is referring to with its "1".  Cells D5, D6, D7 cannot have bombs:  if they did, the number in E6 would be greater than 1.  So we uncover those safely too:
In this way we can make progress uncovering more and more terrain safely and getting more information:
Now we end up in a more touchy situation.  There are a few cells containing "2" and even one with "3".  Fortunately two new cells have a "1" in it (D8 and K7) and only one surrounding covered cell, which therefore must be a bomb.
We can mark those and continue as before, to arrive at:
We have made a lot of progress.  As with the cells having a "1" and only one surrounding covered cell, we notice two cells,  C7 and K6, that bear a "2" and having only two surrounding covered cells:  B6 and D8 for cell C7; L5 and K7 for cell K6.
Both of those cells must be bombs, so we can flag them:
And so on.  At each move we are absolutely certain that we will not step on a bomb.  Until we get to:

This is no longer easy:  finding just those cells that have an exactly predictable number of bombs around them no longer works.

Should we just click a random cell and see what is under it?  No, we can do better!  Take the "1" at M3:  there are only two places that can hold its bomb, it must be in L2 or in M2.  There are no other possibilities.  But either of those assumptions will also count as a bomb in the surroundings of L3.  Then there cannot be a bomb in K2 because that would mean that L3 has in fact two bombs around it!  So we can safely click K2.
This uncovers a "2", not much information gained in this case.

Now look at J3:  its second bomb is either in I2 or J2.  Again, either of those will count as the second bomb for I3.  So H2 cannot have a bomb.

It uncovers a "4", but that is not so important as the fact that now we have a "2" in H3 with only two covered cells around it which must therefore be bombs.
We flag them and can now briefly go back to our simpler process of marking surroundings of single cells and after a while arrive at:

So far we have used three different ways of progressing:

  1. Random click because of total ambiguity (we used this only once, at the very start).
  2. Flagging bombs and uncovering cells with certainty by simple accounting of the surroundings of a single cell.
  3. Deducing where bombs or safe cells are by considering conflicting bomb configurations.


To continue our game, observe the cells around E3:  only three are covered, D2, D3, D4.  Only one of them can contain a bomb, and this bomb must also be the second bomb accounting for the "2" in E4.  Therefore that bomb cannot be in D2 because it would be "out of reach" of E4.  Hence D2 is safe.  It yields a "3" which does not tell us much.
We have so far identified 13 of the 20 hidden bombs.  The 7 bombs left must all be in the as yet covered area.  If we try bomb configurations that are not in conflict with the numbers, we should not try to place more nor fewer bombs than are left.  We did not consider this important when the covered area was still large, but as it gets smaller this constraint is clearly important.  This then gives us a fourth way of deducing information:
  1. The total number of bombs must be respected in any theory.

We can try bomb configurations by placing a first one and then trying to place successive ones so each next attempt is not in conflict with the previous ones.  The version I'm using allows tentative placement by shift-clicking cells which then turn a dirty yellow.  This is just a visual aid:  it helps us think.

Since A2 is "1", there must be one and only one bomb in A1 or B1.  Try A1.  Then B1 can't be a bomb and the next cell where we can place a bomb is C1.  Similarly we can flag D1 and E1.  We can't flag F1 because then E2 would have 3 instead of 2.  G1 is OK, then going down a row we flag C2, can't flag D2 (E2=2) nor C3 (B2=3) nor D3 (E2=2), must flag C4 (B3=2).

Stuck!  E3=1 but has no bomb around it.  Not only have we placed 7 bombs (which is all that remains) but we cannot place a bomb anywhere in D2, D3, D4 without causing a conflict for the numbers.  We need to backtrack to the last time we had a choice to make.  That was at E1.  Not flagging E1 still leads to a conflict, so our error is even before E1.  If you are very systematic and persevering, you will get these 6 possible combinations that are not in conflict with the numbers:
P1 P2
P3 P4
P5 P6

If we put the six patterns on top of each other, we see:  only D2 never has a bomb and there is no cell that always has a bomb.  We uncover D2 which gives 3.  That at least eliminates P2, P5 and P6 because those have 4 bombs around D2.
From combining P1, P3 and P4 we see that B1 never has a bomb and that C2 and F1 always have one.  We mark and uncover:
Since B1 has a 3, it means A1 and C1 must be bombs.  The only possible pattern is now P1 and we have won!
We were lucky:  there could have been an ambiguous situation such as at the right, in which either one of the covered cells can be the bomb and we would have to make a guess.

Valid XHTML 1.0 StrictValid CSS

next planned revision: 2005-06-01