Bug 446780

Summary: Losing a game should produce a new random grid
Product: [Applications] kmines Reporter: John Eric <johneric>
Component: generalAssignee: Dmitry Suzdalev <dimsuz>
Status: RESOLVED INTENTIONAL    
Severity: normal CC: kde-games-bugs-null, yaxollum
Priority: NOR    
Version First Reported In: 4.0.21081   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

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.