Making Explainable Minesweeper

https://news.ycombinator.com/rss Hits: 11
Summary

馃幃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鈥檚 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鈥檚 not easy to figure out which squares have mines and which don鈥檛. It鈥檚 also difficult to accurately guess the mine locations because there are too few mines. 50/50 Situations Let鈥檚 look at this situation. This image is from this source, and it鈥檚 exactly a 50/50 probability. There鈥檚 1 mine left, and whichever of the two remaining squares you choose, there鈥檚 a chance it could be a mine. This situation occurs due to Minesweeper鈥檚 map generation algorithm. The original Minesweeper usually doesn鈥檛 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鈥檛 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鈥檚 a common mistake that beginners like my past self often make. They think it鈥檚 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鈥檚 go back to the previous image: Here鈥檚 how to interpret this image. The pur...

First seen: 2025-07-09 21:36

Last seen: 2025-07-10 07:38