1M Cell Minesweeper
bl.ocks.org
bl.ocks.org
IMO these solve the problem at the start of the game, because there's already an exposed edge you can work from. Someone, somewhere, had to make the first click; but from that point on every other player has a choice to avoid that experience.
Here's one such implementation: https://m3o.xyz/
That said, I don't think the concept of "the entire map" makes sense. I expect it's functionally infinite, probably capable of scrolling to 2^32 or 2^64 cells, only allocating new regions in the database as people scroll there and start working. On that scale, you probably wouldn't see any activity at all.
The first Twitch Plays you can play with... your mouse!
We can go up to 10k cells max, but you can sweep mines with friends.
---
(5 hours later) that user is me.
This reminded me of Tim Urban's article about numbers: [From 1 to 1,000,000](https://waitbutwhy.com/2014/11/from-1-to-1000000.html). In that article he has an image with a million tightly packed dots - that should give you an idea of how big this Minesweeper game is!
I was once in Copernic Science Centre (Warsaw, Poland), and they had some cylinders with tiny plastic spheres (imagine 1-2mm diameter each sphere). One of the cylinders was supposed to have 100k? 1m? spheres (or some similarly crazy number) and only 1 red sphere, and I remember I was rotating that cylinder for a couple of minutes (it is not tightly packed to the spheres can move around) and eventually I saw the red sphere.
Ps: on the URL of the parent.. I could not find the red dot.. I gave up after a couple of minutes. I will though try the following (later tonight). Save the image, take it to Photoshop, pick the "black color", use that to erase all the similarly colored (black) dots, and the red one will remain behind for me to easily spot.
And if so, if you can make the generation efficient (polynomial time).
I should have asked that in the Pure Skill Minesweeper thread [1], but only thought of it more recently.
"The first square you open is guaranteed to be safe, and (by default) you are guaranteed to be able to solve the whole grid by deduction rather than guesswork. (Deductions may require you to think about the total number of mines.)"
I don't know about the runtime though.
I do wish that it allowed me to pick a higher fraction of mines. I found the pure skill minesweeper a lot more challenging (and therefore satisfying) when I increased the fraction from 20% (30 mines on 10x15) to 33.3% (50 mines).
Edit: just played it a bit.. nice.. need to keep the balance on stock, unsold inventory, etc..
Whether you lose on move 1 or move 2 due to bad luck is not a big difference
A simple algorithm would be to re-do the map generation until there is no mine collision, but with larger numbers of mines, the collision chance increases, so your runtime will go up superlinearly. A simple but very effective improvement is to keep the positions of the mines up until the collision and then only change the seed for subsequent mines. Then your algorithm should in fact scale much better. You can also use different methods, like assigning indices in a certain way so that invalid states are avoided completely. A bit more complicated but way "cleaner".
It happens so fast behind the scenes that the user isn't aware of it, and it makes sure I won't have to guess anything when I play. Purely skill, no random.
I feel like you've forgotten the purpose of a hobby.