()
| 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() { |
no test coverage detected