MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / checkForWin

Function checkForWin

assets/js/Minesweeper.js:204–219  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

202
203 //check for win
204 function checkForWin() {
205 let matches = 0;
206
207 for (let count = 0; count < squares.length; count++) {
208 if (
209 squares[count].classList.contains("flag") &&
210 squares[count].classList.contains("bomb")
211 ) {
212 matches++;
213 }
214 if (matches === numBombs) {
215 result.innerHTML = "YOU WIN!";
216 isGameOver = true;
217 }
218 }
219 }
220});

Callers 1

addFlagFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected