137

Is it possible for some unlucky guy to hit a mine when they click the first square randomly?

nalzok
  • 2,155
  • 2
  • 15
  • 25

2 Answers2

148

It is impossible to click a mine on the first click, at least in Windows 98. 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. It does not appear the behavior has changed since then.

Source

SQB
  • 1,625
  • 3
  • 16
  • 28
Galen Nare
  • 1,245
  • 1
  • 9
  • 13
  • 7
    On newer versions (Win 7+) it should be possible to hit a mine with the first click. – dly Aug 02 '17 at 06:40
  • 3
    What if all four corners are occupied? – nalzok Aug 02 '17 at 08:34
  • 7
    @SunQingyao It's not trying the right corner, it's trying the left corner +1 (e.g. one step right). If the top row is full, it tries the next row. This could only fail if the entire board were full of mines, which I believe is not allowed in the game configuration. – Samthere Aug 02 '17 at 09:46
  • 51
    @dly That's only possible if you restart the same game, keeping the mines in the same places. Under normal conditions, Win7 Minesweeper doesn't generate the board until after the first click, and it also ensures that the first click is always a 0. – Toomai Aug 02 '17 at 10:30
  • @Toomai: A 0 or just "not a mine"? – Deduplicator Aug 02 '17 at 11:27
  • 1
    Assuming that starting with the top left skips step 1 and tries with the cell to the right? – Batophobia Aug 02 '17 at 13:02
  • @Batophobia yes I believe that is correct. – Galen Nare Aug 02 '17 at 13:26
  • 4
    I have tried this on this link: https://copy.sh/v86/?profile=windows98 and it seems it is correct. There's no way to lose on the first click and I have deleted the other answer I had provided before. – John Hamilton Aug 02 '17 at 14:15
  • Not on 1st, but it's highly likely to touch a mine on 2nd if you don't go by logic. – ABcDexter Aug 02 '17 at 17:00
  • 2
    Seems like you could hit a mine on the first hit, if you selected the box to the right of the top-left corner, assuming both boxes had a mine in it. – Rob Aug 03 '17 at 03:54
  • @Rob Because the game would remove it from that square, then replace it? That's surely not the intended behaviour and would appear to be either a bug in the description or the implementation. (It could be avoided by first placing an extra mine on a free square, then removing the mine from the original square.) – David Richerby Aug 03 '17 at 15:05
  • I have a minesweeper game in a puzzle app on my phone and it starts generating the game as soon as I tap the first field. Interesting that the original minesweeper doesn't do this. – Fabian Röling Nov 20 '17 at 13:35
  • @Samthere: If the board is full of mines it's an instawin. You don't need to mark the mines, you just need to click all non-mines. – Flater Sep 13 '19 at 15:01
122

No, it is (normally) not possible to hit a mine on the first click in Microsoft's implementation of Minesweeper.

It is pretty easy to convince yourself that it is impossible to lose on the first click. Here's a test that I do to gauge the quality of other Minesweeper implementations: Run Minesweeper, create a custom game, and set the board size and number of mines to their maximum allowed values. The Windows 7 version of Minesweeper allows a 24x30 board with 668 mines (92.7% of the board). Start a game, click a random square. Create a new game, repeat. Do it a few more times. The probability that all your first clicks happen to be lucky quickly gets very small (e.g., after 5 times, the probability that you got lucky on all your first clicks drops to (1 - 0.927)5 ≈ 0.000002). Since that is so improbable, the game must be guaranteeing that the first click is always safe. (If that low probability doesn't convince you, keep repeating until it's low enough that it does.)

Additionally, on Windows 7 and later, if you choose to restart a game (with tips enabled), Minesweeper shows a message:

The mines are in the same position as last game. Be careful! You can lose on the first click.

The last sentence implies that normally you cannot lose on the first click.

Finally, old versions of Minesweeper had an xyzzy cheat code that indicated whether a square contained a mine. However, when enabling this cheat, clicking on a square that is reportedly a mine will not reveal a mine for the first click, providing further evidence that the game has special logic to prevent a first-move loss. (I have verified that this is true at least as far back as Windows 3.1.)

jamesdlin
  • 1,356
  • 1
  • 9
  • 14
  • 17
    So if the objective is to make sure there are no mines, and the mines only get placed after your first click... does that mean someone who ends the game without clicking would have completed the objective? – Stephan Bijzitter Aug 03 '17 at 10:20
  • 33
    @StephanBijzitter The only winning move is not to play? – Malco Aug 03 '17 at 13:23
  • 2
    @StephanBijzitter the objective is to know where the mines are and which spots are safe. Technically, for the first step, all spots are, though. – Chieron Aug 03 '17 at 17:43
  • 7
    @StephanBijzitter Until the first click, the game is simultaneously lost and won. =P ... well, actually, the objective of the game is to reveal all non-mine squares, so no, you have not won without clicking. – jamesdlin Aug 03 '17 at 18:23