Summary of What Needs to be Done
Fix the game loop in games/Minesweeper/minesweeper.py. The check_victory() method is called after the user action (dig or flag) and the result is stored in game.victory. However, since the while loop checks not game.victory as its condition (along with not game.game_over), if a player wins by revealing all non-mine cells on their move, game.victory becomes True but the loop condition not game.game_over and not game.victory immediately becomes False, exiting the loop WITHOUT displaying the victory banner. The next action (hitting a mine) then shows the game-over banner instead.
Changes that Need to be Made
Move the check_victory() call to be evaluated as part of the loop condition itself, or restructure the win detection so that winning is handled before the next prompt is shown. The simplest fix is to check check_victory() immediately after each action (dig or flag), BEFORE the next iteration of the prompt loop.
Impact that it would Provide
Players who win by revealing all non-mine cells will see the victory banner and board, rather than the game over screen from their next (accidental) mine hit.
Note: please assign this issue to the tmdeveloper007 account.
Summary of What Needs to be Done
Fix the game loop in
games/Minesweeper/minesweeper.py. Thecheck_victory()method is called after the user action (dig or flag) and the result is stored ingame.victory. However, since the while loop checksnot game.victoryas its condition (along withnot game.game_over), if a player wins by revealing all non-mine cells on their move,game.victorybecomesTruebut the loop conditionnot game.game_over and not game.victoryimmediately becomesFalse, exiting the loop WITHOUT displaying the victory banner. The next action (hitting a mine) then shows the game-over banner instead.Changes that Need to be Made
Move the
check_victory()call to be evaluated as part of the loop condition itself, or restructure the win detection so that winning is handled before the next prompt is shown. The simplest fix is to checkcheck_victory()immediately after each action (dig or flag), BEFORE the next iteration of the prompt loop.Impact that it would Provide
Players who win by revealing all non-mine cells will see the victory banner and board, rather than the game over screen from their next (accidental) mine hit.
Note: please assign this issue to the
tmdeveloper007account.