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

Function checkBoardForFinalWin

assets/js/sudoku.js:454–477  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

452 }
453
454 function checkBoardForFinalWin() {
455 //weed out non wins
456 for (var i = 0; i < 81; i++) {
457 if (board.board[i].val == ' ') {
458 return
459 };
460 }
461
462 function rndRGB() {
463 return Math.floor(Math.random() * 255);
464 }
465
466 function yayIWon() {
467 document.body.style.backgroundColor = "rgb(" + rndRGB() + "," + rndRGB() + "," + rndRGB() + ")";
468 }
469
470 document.getElementsByTagName('h1')[0].innerHTML = "CONGRATULATIONS!!! You Win!!!"
471
472 var pleaseStop = window.setInterval(yayIWon, 500);
473 window.setTimeout(function() {
474 clearInterval(pleaseStop);
475 document.body.style.backgroundColor = "#e5ecf3";
476 }, 10000);
477 }
478
479 //=====================
480

Callers 1

sudoku.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected