Skip to content

Commit

Permalink
Allow 'treat flag as mine' to be optional in analysis mode
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidNHill committed Aug 15, 2024
1 parent 309c373 commit d4cf5a3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
Binary file modified .vs/slnx.sqlite
Binary file not shown.
3 changes: 2 additions & 1 deletion Minesweeper/client/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2090,7 +2090,8 @@ async function doAnalysis() {

// this will set all the obvious mines which makes the solution counter a lot more efficient on very large boards
if (analysisMode) {
board.resetForAnalysis(!replayMode, true); // in replay mode don't treat flags as mines
const flagIsMine = document.getElementById("flagIsMine").checked;
board.resetForAnalysis(!replayMode && flagIsMine, true); // in replay mode don't treat flags as mines
}

const solutionCounter = solver.countSolutions(board);
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ <h1 id="headerPanel" style="position: absolute; left: 0px; top: 0px; height: 50p
<div style="margin-top: 1em; display: none;" class="checkboxes" id="analysis1">
<label><input type="checkbox" class="checkbox" id="buildMode" checked /> <span>Build mode</span></label>
<label><input type="checkbox" class="checkbox" id="lockMineCount" /> <span><u>L</u>ock mine count</span></label>
<label><input type="checkbox" class="checkbox" id="flagIsMine" checked /> <span>Treat flags as mines</span></label>
</div>

<button type="button" style="margin-top: 1em;" id="AnalysisButton" onclick="doAnalysis()"><u>A</u>nalyse</button>
Expand Down

0 comments on commit d4cf5a3

Please sign in to comment.