# Filling in an 8x8 minesweeper grid with mines (Day 5: Mod 4)

Disclaimer: ascii85(z85 (Zero MQ) encoding)(ra]?=AclFMy?j-3z/M%*vr&$uhxV<Jxj#xfByw@@ayMypxLzo]aARJAzddi>efG1FzEWl2nHFu$BzbxayIvW0aA7<mx(mA%B.2i7xcpV1vqY<6BzkM5B0bNrvrrS2A+cwmB-qqrB7F(8Bz&pzxMw3naBd)FaA7>7azbUjz6j4owPzu8D2E*MA+cw4v@#<4y&1wtB9hCvz/YG2aARJAAbn@)wGV8dwO&$vvqH16aARpdaA?Eux<$)&az$+8xj$:)A=SviA+cwaz!T94aARJAvR3V[wncc%wftq[vqfQ4B7]J4wGVhgC{40yBrz#DB-RTEBz&psvqxA%x(>Fmz/PziwnbT/x>8p4Bsv)

Based off of Day 29 - Modulo 3 on heptavegeesimal.com

What is the gimmick for today, you might ask? Well, the number that you are shown might not be the actual amount of mines around it. If you're unfamiliar with what a modulo is, here is what it is: Say we have a number $$27$$ and we divide it by $$4$$. We have$$27\equiv3\pmod4\because4\cdot\{27/4\}=3$$where $$\{x\}$$ is the fractional part function, which can also be represented as $$x-\lfloor x\rfloor$$ or $$\text{Sawtooth}[x]:=x\pmod1$$. Now, to make this day easier, there are only going to be double and triple mines. Here is the grid:

2 0 2 1
2 1 1 0
1 1 3 0 0
$$\color{white}{.}$$
1 0 1 2
0 1
3 0 1 2
2 0 3 1

There are 22 double mines (2) and 15 triple mines (3).

Okay so hopefully there isn't a mistake and I have done my linear algebra correctly. I was able to solve the puzzle, so I think there isn't a mistake, but still.

 Actually, now that I think about it, we could also think of modulo 4 as$$x\pmod4\ge4\{x/4\}=x-4\lfloor x/4\rfloor$$because we have$$x\pmod n\ge x-n\lfloor x/n\rfloor\qquad x,n\in\mathbb R,n\ne0$$which is confirmed by Wolfram Alpha.

• There's a white full stop. Is that intentional? Oct 28 at 2:23
• This seems impossible to solve given the amount of mines available. The grid has 37 empty cells, but we have 38 mines available Oct 28 at 11:35
• @Bart-JanvanRossum It's fixed now, I miscounted a double mine. Oct 28 at 13:54
• Unless I completely misunderstand your rule set, I think trying to solve this very quickly leads to an impossible situation. rot13(N mreb jvgu gjb rzcgl pryyf arkg gb vg pna bayl unir gjb gjbf va gubfr pryyf. Jvgu guvf e2p3 unf gb or gjb naq gur pryyf fheebhaqvat gur mrebf va gur gbc evtug nf jryy. Guvf tvirf n 3 va e1p6 naq n 2 va e2p5. Ohg gura gur gjb gbc pryyf va pbyhza 4 unir gb fhz obgu gjb 2 naq 0 juvpu vf vzcbffvoyr. ) Oct 28 at 16:09
• Are you trying to say that the the numbers displayed are the number of neighboring mines modulo 4? If so, you should state it clearly. Oct 28 at 17:38