š®Game š§©Puzzle š£Minesweeper š¤Algorithm š»Game Dev
Background
I recently purchased and played a game called 14 Minesweeper Variants during a Steam Summer sale. It was a fun game. However, I became curious while looking at the hints provided in the game. What exactly are these?
Actually, when I played Minesweeper, which was a default Windows game, I could solve cases where there was a definite answer, but I remember stepping on countless mines in ambiguous situations. For example, situations like this:
The numbers 1 and 2 indicate the number of mines in each cellās 8 neighbors (up, down, left, right, and diagonals). Empty cells mean there are no mines in their neighbors. However, in situations like the image above, itās not easy to figure out which squares have mines and which donāt. Itās also difficult to accurately guess the mine locations because there are too few mines.
50/50 Situations
Letās look at this situation. This image is from this source, and itās exactly a 50/50 probability. Thereās 1 mine left, and whichever of the two remaining squares you choose, thereās a chance it could be a mine.
This situation occurs due to Minesweeperās map generation algorithm. The original Minesweeper usually doesnāt let you step on a mine on your first click. This is because it places mines in locations other than the square the user selects on their first click. Since mines are placed at that moment, it canāt perform enough calculations to prevent 50/50 situations. When I experimented, finding boards solvable only through logical deduction required about 250,000 attempts per level on a 9x9 board with 33 mines.
Situations Where Deduction is Possible
However, thereās a common mistake that beginners like my past self often make. They think itās a 50/50 situation and leave it to luck when deduction is actually possible! The 14 Minesweeper Variants I mentioned earlier provides hints for such situations. Letās go back to the previous image:
... continue reading