This week's book giveaway is in the Kotlin forum.We're giving away four copies of Kotlin Cookbook and have Ken Kousen on-line!See this thread for details.
Win a copy of Kotlin Cookbook this week in the Kotlin forum!
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
• Campbell Ritchie
• Liutauras Vilda
• Bear Bibeault
• Paul Clapham
• Jeanne Boyarsky
Sheriffs:
• Junilu Lacar
• Knute Snortum
• Henry Wong
Saloon Keepers:
• Ron McLeod
• Tim Moores
• Stephan van Hulst
• Tim Holloway
• Carey Brown
Bartenders:
• Frits Walraven
• Joe Ess
• salvin francis

# minesweeper: solve a clueless piece without guessing

Ranch Foreman
Posts: 91
4
So, I played a bit minesweeper and encountered this pattern (I use 0 for an empty piece and M for a mine):

So, as one can see: I have two pieces wich both could be a mine, but only one of them is. The 3 left to them is only checked by two mines left of it, the 5 by the two mines left of it, the two below it and the pieces in question. From the right side the 3 is only checked by the two below it (wich is confirmed by the 2 and the 1 on the right). The top-row is the top-most of the game - so there's no row above it I could use.
So, from this pattern at least I can figure out that only one of the questionmarks is a mine, but I can not figure out wich one it is. Is there any other way than just guessing?

Kris

Saloon Keeper
Posts: 5989
154
No, because there is no number field that covers just one of the two fields in question. Minesweeper involves a fair amount of guessing on the more difficult levels :-)

Kristina Hansen
Ranch Foreman
Posts: 91
4
Well, so I took a guess and of course I clicked the wrong one.
I'm pretty good at advanced and higher settings - but only very rarely complete expert levels. What always surprise me: When playing against leaderboards there're some entries with expert times around just 60 seconds - were I always need up to 5 minutes to get just to a point where hard thinking is required. Is it possible just to get lucky and get an easy board on expert or is there some tatcics with it to quickly clean hard boards?
My big problem is mostly: even with enough time I run into situations where even with hard thinking I end up with guessing moves, wich mostly fail (and when the mines revealed it seems there was no way to get it correctly just by what was known up until the fatal click. Sure, sometimes it's just stupid mistakes, wich, when analyzed, reveals: ok, there had been this one tile that could had given a clue to proceed - but it then only gives two or three additional tiles and often end up in moves again wich, at least I, have to gamble again.

It's fascanating that such a simple game can get so addictive, pretty much like tetris.

Saloon Keeper
Posts: 11027
244
A few years ago I had a couple of weeks where I was addicted to the game. After a while, you start recognizing patterns and you stop reasoning, allowing you to click through the problem blazingly fast.

Bartender
Posts: 3674
151
But the very first click is also a gamble, since you have no clues at all. I made a version in the 90's, that gave the user an option to have a guaranteed non-bomb left upper corner.

Kristina Hansen
Ranch Foreman
Posts: 91
4
Well, long time ago I read something along the lines that for "official" leaderbords and tournaments only very few implementations in very specific versions are allowed. This extends that far, that one of rules state that the first has to be guarenteed an empty field, the rest of the board gets random generated after that first free click, but has to follow some odd but specific rules about how much has to be exposed and what values are allowed so that at least a few next moves are also guaranteed to be possible. In fact, it's pretty tight rules for such a game, but same goes with Tetris.

Stephan van Hulst
Saloon Keeper
Posts: 11027
244
You can generate a board with a deterministic solution pretty easily if you know the first square that the user selected and you use back-tracking during generation, but generating such a board in polynomial time probably requires much more mental gymnastics.

 He's dead Jim. Grab his tricorder. I'll get his wallet and this tiny ad: Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous