# Binary Minesweeper

This Puzzle is a form of the classical MS Minesweeper which keeps popping into my head. In Minesweeper, a 2D grid is filled with mines and numbers whereas each number represents how many of its 8 adjacent tiles are occupied by mines.

The main rule of this puzzle is that only two types of tiles may be used: Mines (m) and one number. So instead of using all numbers ranging from 0(blank) to 8, you have to select only one of it (except 0) and fill a rectangular grid with it. Of course, the Minesweeper rules still apply so the numbers must still represent the number of adjacent mines.

The grid size can be freely chosen but must not be infinite so whatever pattern you may find must work with the edges as well. I do not yet have solutions for all numbers but some of them. As an example, here are the trivial solutions for 1 and 8:

Example (1)

+- - - - - - - - - - - - +
|1 1 1 1 1 1 1 1 1 1 1 1 |
|1 m 1 1 m 1 1 m 1 1 m 1 |
|1 1 1 1 1 1 1 1 1 1 1 1 |
|1 1 1 1 1 1 1 1 1 1 1 1 |
|1 m 1 1 m 1 1 m 1 1 m 1 |
|1 1 1 1 1 1 1 1 1 1 1 1 |
+- - - - - - - - - - - - +


Example (8)

+- - - - - - - - - +
|m m m m m m m m m |
|m 8 m m 8 m m 8 m |
|m m m m m m m m m |
|m m m m m m m m m |
|m 8 m m 8 m m 8 m |
|m m m m m m m m m |
+- - - - - - - - - +


Note: The above examples do not work for arbitrary grid sizes, only for multiples of 3 in both axes. Such restrictions are allowed for the solutions. Just make sure they are large enough so that an actual pattern can be identified

Note: You can use any notation for the mines you like as with some numbers, some characters are better distinguishable than others

• I'll venture a guess and say that there probably aren't patterns for the other numbers. – EFrog Jan 21 '15 at 12:46
• I have not yet found patterns for all numbers but I do know some – Bowdzone Jan 21 '15 at 13:15
• The 8 example can work for any grid size 3x3 or larger by adding or removing the extra rows or columns of mines. – Jabe Jan 21 '15 at 13:50
• @Jabe Yes you are right but that is kind of cheap ;-) – Bowdzone Jan 21 '15 at 14:02
• Perhaps a more interesting question would require a pattern where no mine touches 8 other mines (easier edges), or one where every mine must touch a number (harder edges) – Jabe Jan 21 '15 at 14:06

For 2:

+- - - - - - - - - - +
|m 2 2 m 2 2 m 2 2 m |
|m 2 2 m 2 2 m 2 2 m |
|2 2 2 2 2 2 2 2 2 2 |
|m 2 2 m 2 2 m 2 2 m |
|m 2 2 m 2 2 m 2 2 m |
+- - - - - - - - - - +

I'll leave my solutions for 3 and 4 here, but @Jabe has much better ones.
For 3:

+- - +
|m m |
|m 3 |
+- - +

For 4:

+- - +
|m m |
|4 4 |
|m m |
+- - +

For 5:

+- - - - +
|m m m m |
|m 5 5 m |
|m 5 5 m |
|m m m m |
+- - - - +

For 6, I came up with one that's not the same as @Jabe, but turns out to be a bigger version of the one @kasperd has. You can expand this one by making a bigger diamond as well as just sticking blocks together, and you can also nest the diamonds.

+- - - - - - - +
|m m m m m m m |
|m m m 6 m m m |
|m m 6 m 6 m m |
|m 6 m m m 6 m |
|m m 6 m 6 m m |
|m m m 6 m m m |
|m m m m m m m |
+- - - - - - - +

... and just because I can:

+- - - - - - - - - - - +
|m m m m m m m m m m m |
|m 6 6 m m 6 m m 6 6 m |
|m 6 m m 6 m 6 m m 6 m |
|m m m 6 m m m 6 m m m |
|m m 6 m m 6 m m 6 m m |
|m 6 m m 6 m 6 m m 6 m |
|m m 6 m m 6 m m 6 m m |
|m m m 6 m m m 6 m m m |
|m 6 m m 6 m 6 m m 6 m |
|m 6 6 m m 6 m m 6 6 m |
|m m m m m m m m m m m |
+- - - - - - - - - - - +

For 7:

+- - - - +
|m m m m |
|m 7 m m |
|m m 7 m |
|m m m m |
+- - - - +

And of course, for any n:

+- - - - +
|m m m m |
|m m m m |
|m m m m |
|m m m m |
+- - - - +

• Supposed to be large enough to identify a pattern. – user2097159 Jan 21 '15 at 13:27
• I'm not sure what "identify a pattern" means here. Apart from the smart-alec "n" answer, which ones are failing that condition? – Callidus Jan 21 '15 at 13:32
• 2,5 and 7 are great but 3 and 4 can't be multiplied in both directions while remaining valid. Thats what I tried to say with Just make sure they are large enough so that an actual pattern can be identified. – Bowdzone Jan 21 '15 at 13:32
• I see what you mean. You can stick 4 of the 3 solution together, but not unlimited numbers. You can stick unlimited numbers of the 4 solution together, but only in one dimension (vertically). I will think further. – Callidus Jan 21 '15 at 13:38
• @Bowdzone You can actually tile the 4 solution. You just stick another tile on the top or bottom. Read from top to bottom it would be: m, 4, m, m, 4, m, ... – Nick2253 Jan 21 '15 at 15:50

For 3:

+ — — — — — — — — — — — +
| m m 3 m m 3 m m 3 m m |
| m 3 3 m 3 3 m 3 3 m 3 |
| 3 3 3 3 3 3 3 3 3 3 3 |
| m m 3 m m 3 m m 3 m m |
| m 3 3 m 3 3 m 3 3 m 3 |
| 3 3 3 3 3 3 3 3 3 3 3 |
| m m 3 m m 3 m m 3 m m |
| m 3 3 m 3 3 m 3 3 m 3 |
| 3 3 3 3 3 3 3 3 3 3 3 |
| m m 3 m m 3 m m 3 m m |
| m 3 3 m 3 3 m 3 3 m 3 |
+ — — — — — — — — — — — +

For 4:

+ — — — — — — — — — — — +
| m m 4 m m 4 m m 4 m m |
| m m 4 m m 4 m m 4 m m |
| 4 4 4 4 4 4 4 4 4 4 4 |
| m m 4 m m 4 m m 4 m m |
| m m 4 m m 4 m m 4 m m |
| 4 4 4 4 4 4 4 4 4 4 4 |
| m m 4 m m 4 m m 4 m m |
| m m 4 m m 4 m m 4 m m |
| 4 4 4 4 4 4 4 4 4 4 4 |
| m m 4 m m 4 m m 4 m m |
| m m 4 m m 4 m m 4 m m |
+ — — — — — — — — — — — +

For 6:

m m m m
m 6 6 m
m 6 m m
m m m m

• Great solution. I did not have one for 6 so far – Bowdzone Jan 21 '15 at 14:00
• 4 doesn't work you have the mines in the corners that are unaccounted for. – user2097159 Jan 21 '15 at 14:12
• Where does it say each mine must be accounted for? – Florian F Jan 21 '15 at 14:55
• All of these work in my opinion. Nicely done – Bowdzone Jan 21 '15 at 15:11
• @Bowdzone 6 is just the inverse of the 3 pattern. For all these examples, this seems to be true that x and 9-x are inverses of each other. – Trenin Jan 21 '15 at 16:05

Here are the ones I could come up with. Some of them are similar to what the previous answers have come up with, some of them are different.

For 0

0000
0000
0000


For 1

111
1m1
111


For 2

2m22m22m2
2m22m22m2
222222222
2m22m22m2
2m22m22m2
222222222
2m22m22m2
2m22m22m2


For 3

3mmmmmmmmmmmmmm3
mmmmmmmmmmmmmmmm
mmmmmmmmmmmmmmmm
3mmmmmmmmmmmmmm3


For 4

m4m4m4m4m
mm4mmm4mm
m4m4m4m4m


For 5

mmmm
m55m
m55m
mmmm


For 6

mmmmm
mm6mm
m6m6m
mm6mm
mmmmm


For 7

mmmm
m77m
mmmm


For 8

mmm
m8m
mmm


For any number

mmmm
mmmm
mmmm


The patterns for 5 through 8 all have m all around the edges, so the basic building blocks can be placed throughout the grid in any pattern you like by filling in the intermediate blanks with more ms.

My pattern for 4 only works when one of the side lengths is 3. There is a more boring pattern that works when one of the side lengths is 2. And there is an even more boring pattern, which only has numbers near the corners.

Kudos to @Jabe for having more interesting patterns for 3 and 4 than mine.