Minesweeper-Desktop-Game icon indicating copy to clipboard operation
Minesweeper-Desktop-Game copied to clipboard

User can not win because "Game Won" window does not appear

Open KonstantinosGal opened this issue 4 years ago • 4 comments

Logic Bug

I noticed that when the user has pressed (and has revealed) all cells that are not mines the window showing him as a winner does not appear. As a result, there is no action the user can do but press a mine box and lose the game or exit the game. Therefore he can never win. I found the reason behind this and I created a pull request in order to prevent this problematic situation.

I ran the code in IntelliJ IDEA 2021.1.3 (Ultimate Edition) x64 on Windows 10.

I would appreciate it if you could confirm this and answer to me.

User must had won because mines are 10 in total

Must have won

Instead he lost because he pressed an existing mine (no other choice)

Lost

KonstantinosGal avatar Aug 26 '21 22:08 KonstantinosGal

These are the results of the changes I made in the code.

Before the final cell is revealed

b before win OK

Now the window "Game Won" appears

b win OK

KonstantinosGal avatar Aug 26 '21 23:08 KonstantinosGal

Thanks, @KonstantinosGal for the comments. It seems to me that when I initially developed this game, I was able to win it when all non-bomb tiles were explored. Can you verify if this bug happens all the time?

Moreover @AkaruiYami can you verify this bug?

harismuneer avatar Jun 22 '22 04:06 harismuneer

Hello, @harismuneer. I'm not sure about what kind of bug you are referring to but upon trying the game several times.. this is what I found:

The "Game Won" window will only appear when all the tiles are flagged and reveled.


As shown in 2 images below, the "Game Won" does not appear even thou I already revealed all the non-bomb tiles.

test1

test2

Only after I flag all the bomb, the "Game Won" window will appears:

test3 test3-2

Here I only marked the bomb without revealing the non-bomb tiles and the "Game Won" window still not appears.

test6

Only after all tiles were revealed and flagged, the "Game Won" window appears.

test6-2

AkaruiYami avatar Jun 22 '22 06:06 AkaruiYami

@harismuneer yes this bug happens to me all the time. The change I have made to the code (in my pull request) solves this problem.

KonstantinosGal avatar Jun 22 '22 10:06 KonstantinosGal