Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
KonstantinosGal opened this issue Aug 26, 2021 · 4 comments
Open

Comments

@KonstantinosGal
Copy link

KonstantinosGal commented Aug 26, 2021

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
Copy link
Author

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 KonstantinosGal changed the title User can not win because winning window does not appear User can not win because "Game Won" window does not appear Aug 26, 2021
@harismuneer
Copy link
Member

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?

@AkaruiYami
Copy link

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

@KonstantinosGal
Copy link
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants