Your link suggests: "If a mine is under the first clicked tile, it is moved to the upper-left corner, if the upper left corner is occupied, the mine moves to the right of the corner tile." If that happened here, the square would still be a mine.
"The function checks if it is the first click, and that the square being clicked is a mine. It then tries to move the mine to the upper-left corner. If unsuccessful it tries the square to the right of it. If all of the first row is occupied by mines, the function tries to put the mine in the leftmost square of the row below, and so on."
Jokes aside, I love it how in a group of software engineers someone can always think of an even more unlikely, but somehow realistic edge case.
For me, one of the marks of a senior engineer would be to then either go "we'll just not allow the board to be filled with entirely mines in the builder", or "well, if that ever happens: just let it crash". A practical solution to a theoretical case.
Whereas the more junior engineer would spend the next few days researching and refactoring the algorithm to address this case. Obv. "it depends", letting my insuline pump "just crash" isn't cool, but minesweeper, meh.
I always assumed it did things the way I did when I wrote my minesweeper game: it only generated the mines on the first click, avoiding the clicked tile.
I don't know for sure, but they probably didn't plant it at first and later it was simpler to move mine elsewhere than to change the way mines are generated.
Probably performance. It's an old game, it seems faster if the mines can get generated before the user first clicks, and then move the mine if their first click was on a mine. If you wait for them to click to generate then the entire generation step has to run before the user notices.
Since 1993, that's what I've been missing from my mine sweeper game. All these years I couldn't understand why I could never finish the game. Hahaha! :)
There are actually some expert players who intentionally play without the flags as an extra challenge. They have to remember (or re-deduce) where the mines are. The game is considered won whenever the number of unexposed squares, whether explicitly flagged or not, or equal to the total number of mines.
From the “useless web” links provided above, I learned:
> The project was built and launched as part of Netlify’s Dusty Domains project, where for each project built and launched on an old domain money was donated to charity! Ultimately over a hundred thousand dollars was raised for a variety of individual charities.
I remember a long time ago (20 years ago?) playing some Windows minesweeper variant that someone had wrote. It did the "impossible to hit a mine on your first click" thing (That I believe Windows' Minesweeper didn't do), but also had different shapes. You could have a hex map, for example.
68 comments
[ 0.24 ms ] story [ 110 ms ] thread[1]: https://minesweepergame.com/history/xyzzy.php
https://gaming.stackexchange.com/questions/315335/is-it-poss...
https://web.archive.org/web/20180618103640/http://www.techus...
Jokes aside, I love it how in a group of software engineers someone can always think of an even more unlikely, but somehow realistic edge case.
For me, one of the marks of a senior engineer would be to then either go "we'll just not allow the board to be filled with entirely mines in the builder", or "well, if that ever happens: just let it crash". A practical solution to a theoretical case. Whereas the more junior engineer would spend the next few days researching and refactoring the algorithm to address this case. Obv. "it depends", letting my insuline pump "just crash" isn't cool, but minesweeper, meh.
I always assumed it did things the way I did when I wrote my minesweeper game: it only generated the mines on the first click, avoiding the clicked tile.
I wonder why they did it that way?
Since 1993, that's what I've been missing from my mine sweeper game. All these years I couldn't understand why I could never finish the game. Hahaha! :)
There are actually some expert players who intentionally play without the flags as an extra challenge. They have to remember (or re-deduce) where the mines are. The game is considered won whenever the number of unexposed squares, whether explicitly flagged or not, or equal to the total number of mines.
> The project was built and launched as part of Netlify’s Dusty Domains project, where for each project built and launched on an old domain money was donated to charity! Ultimately over a hundred thousand dollars was raised for a variety of individual charities.
https://magnushoff.com/articles/minesweeper/
(scroll to the bottom)
Anyone know what I'm thinking of?