-2

I am about to design my own minesweeper in Java. And while analyzing the real windows 7 minesweeper, I came across this situation.

1 or 0 ?

The uncovered square(pointed by arrow), may be 1 or mayn't have any number(an empty square). But in windows 7 minesweeper, this square has 1.

hypothesis: And by analyzing I came to know that all the mines are always surrounded by numbers.

If I go with my hypothesis, then no other go, the uncovered square should be 1.

And designing the logic for the minesweeper will be easier, if I follow this hypothesis. since,

step 1: Randomly assign the squares with mines.(Make the specific (i,j)element in the 2D array to be -1).

step 2: Number each square, equal to the number of mines surrounding it. (In this case, the hypothesis became true).

And my questions are,

  1. What wrong if the uncovered square is an empty square?
  2. Does that hypothesis is the rule in minesweeper?
  3. Does I have to follow the hypothesis, to make my coding simpler to implement?
  4. *If I proposed a new minesweeper with the rule against the hypothesis, does my new minesweeper will end up in instability?Is so,how?

*->I am not intentionally breaking the rules, I try to removing redundant hint/keys to the user.

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
Muthu Ganapathy Nathan
  • 3,199
  • 16
  • 47
  • 77
  • I mean, this question just requires an explanation of the rules of minesweeper. It's not even a programming question. – Wayne Jan 27 '14 at 01:24
  • This question appears to be off-topic because it is not a programming question. – Wayne Jan 27 '14 at 01:24
  • This position with the arrow must have a `1`. If it was `blank`, and the first click on the board revealed it as "empty", it would (falsely) be an indication that all spaces surrounding it had no mines. Also, the normal behavior when clicking an empty space is to reveal all adjacent spaces. In this case, this would not happen. – Kevin Fegan May 22 '16 at 00:36
  • I'm voting to close this question as off-topic because this question is about the rules of the minesweeper game, not about programming. – Thierry Lathuille Jan 25 '18 at 09:34

3 Answers3

10

Of course the pointed square has a number - it is adjacent to (exactly one) mine square so it gets a 1. The empty squares are just shorhand for zero.

hugomg
  • 68,213
  • 24
  • 160
  • 246
  • If I proposed a new minesweeper with the rule against the hypothesis, does my new minesweeper will end up in instability? – Muthu Ganapathy Nathan Aug 13 '11 at 04:41
  • 2
    If your minesweeper intentionally breaks the rules, it's no longer playable. Whether you realize it or not, those numbers are essential in figuring out where the mines are -- precisely because they work the way they do. – cHao Aug 13 '11 at 04:48
  • @cHao I am not intentionally breaking the rules, I try to removing redundant hint/keys to the user.Here, the arrowed square is redundant information. – Muthu Ganapathy Nathan Aug 13 '11 at 05:00
  • @cHao How removing a redundant information will make the game no longer playable? – Muthu Ganapathy Nathan Aug 13 '11 at 05:14
  • 2
    Removing all the redundancy would be equivalent to solving the puzzle. Keep in mind, the goal isn't to mark the mines, it's to clear all the squares that *aren't* mines. And you do that by observing where the numbers don't make sense, and chipping away at the squares. – cHao Aug 13 '11 at 05:17
  • If the numbers no longer work the way they do, then you can't trust them when they say "there's no mine here". Clicking becomes basically praying and clicking at random. In short, the game's no longer a game of skill; it becomes a game of chance. – cHao Aug 13 '11 at 05:22
  • @cHao let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/2434/discussion-between-eager-student-and-chao) – Muthu Ganapathy Nathan Aug 13 '11 at 05:33
  • If you decide to remove some of the hints, you should at least distinguish graphically between "no hint" and "blank" (0 adjacent mines). I think this could be an interesting variant of Minesweeper. – rettvest Aug 13 '11 at 08:56
6

The square could not be unnumbered, the numbers represent how many mines are touching that square. Unnumbered squares are "0", meaning no mines touching.

So yes, a mine must always be surrounded by numbered squares.

Dennis
  • 482
  • 7
  • 17
0

The reason you don't see a number there is the fill algorithm of minesweeper.
It reveals all the fields which have a 0 value (0 is shown as empty). And it reveals all the adjacent fields to those revealed before, which have a non zero value.
The field in the corner does not have an adjacent zero value field and thus cannot be revealed automatically.

It carries a 1.

If you'd have a 10x11 field with the last row being empty, This field would be revealed with value 1.

The reason why the Windows version shows a one may be that you already marked all the existing mines with flags and so Windows Minesweeper reveals all the remaining fields.

yunzen
  • 32,854
  • 11
  • 73
  • 106