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

Function checkForWin

assets/js/2048.js:185–193  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

183
184 //check for the number 2048 in the boxes to win
185 function checkForWin() {
186 for (let i = 0; i < boxes.length; i++) {
187 if (boxes[i].innerHTML == 2048) {
188 resultDisplay.innerHTML = 'You WIN'
189 document.removeEventListener('keyup', control)
190 setTimeout(() => clear(), 3000)
191 }
192 }
193 }
194
195 //check if there are no zeros on the board to lose
196 function checkForGameOver() {

Callers 2

combineRowFunction · 0.70
combineColumnFunction · 0.70

Calls 1

clearFunction · 0.70

Tested by

no test coverage detected