Bug 446780 - Losing a game should produce a new random grid
Summary: Losing a game should produce a new random grid
Status: RESOLVED INTENTIONAL
Alias: None
Product: kmines
Classification: Applications
Component: general (show other bugs)
Version: 4.0.21081
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Dmitry Suzdalev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-10 12:38 UTC by John Eric
Modified: 2023-08-13 16:53 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Eric 2021-12-10 12:38:40 UTC
SUMMARY
After losing a game, "Reset the Game" gives the exact same grid again. It is therefore trivial to make a high score by memorizing the grid or taking a screenshot. The grid should be randomized.

STEPS TO REPRODUCE
1. Lose a game, then remember which cells have mines
2. Select "Yes" on the dialog "Reset the Game"
3. Click one of the previous cells where mines are located. The grid is exactly the same, and the game is immediately lost.

OBSERVED RESULT
After losing a game, there is never a new grid. To generate a new grid, one should switch to a game with a different difficulty level and then back to the previous difficulty.

EXPECTED RESULT
Randomize the grid. The method `void MineFieldItem::resetMines()` should probably call `MineFieldItem::generateField` (or a some other method that reads `random`).

SOFTWARE/OS VERSIONS
Linux Kubuntu Impish
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.86.0
Qt Version: 5.12.0

ADDITIONAL INFORMATION
Comment 1 yaxollum@gmail.com 2023-08-13 16:53:09 UTC
In KMines, "resetting" the game is supposed to give you the exact same grid.

If you want a new grid, you should:
1. Select "No" when the "Reset the Game?" dialog pops up
2. Start a new game using "Ctrl + N" or by pressing the "New" button on the top left corner

If you want to disable the "Reset the Game?" dialog completely, you can go into the General settings and uncheck the "Allow KMines reset" checkbox.