diff --git a/style.css b/style.css index cb7d2fc..2e07d5d 100644 --- a/style.css +++ b/style.css @@ -32,12 +32,12 @@ tr:nth-child(3n) { } .container { - width: 378px; - margin: 5px auto; + width: 378px; + margin: 5px auto; } .buttonsContainer { - margin-top: 5px; + margin-top: 5px; width: 380px; height: 60px; } @@ -49,40 +49,40 @@ tr:nth-child(3n) { } .givenNumber { - color: red; + color: red; } .solvingNumber { - color: blue; + color: blue; } .generateButton { float: left; - width: 170px; + width: 170px; font-size: 17px; - cursor: pointer; + cursor: pointer; height: 52px; - line-height: 50px; + line-height: 50px; border-radius: 10px; } .solveButton { float: right; - width: 170px; + width: 170px; font-size: 17px; - cursor: pointer; + cursor: pointer; height: 52px; - line-height: 50px; + line-height: 50px; border-radius: 10px; } .solveButtonWithImidiateDrawing { margin-top: 5px; - width: 380px; + width: 380px; font-size: 17px; - cursor: pointer; + cursor: pointer; height: 52px; - line-height: 50px; + line-height: 50px; border-radius: 10px; } diff --git a/sudokuSolver.html b/sudokuSolver.html index c490bb1..ff775ef 100644 --- a/sudokuSolver.html +++ b/sudokuSolver.html @@ -115,6 +115,5 @@
- \ No newline at end of file diff --git a/sudokuSolver.js b/sudokuSolver.js index 472e14d..18a412f 100644 --- a/sudokuSolver.js +++ b/sudokuSolver.js @@ -161,7 +161,6 @@ function solveUsingBacktrack() { //removeCandidateFromGrid(positionOfCandidate); drawElement = [positionOfCandidate,"0"]; drawGrid.push(drawElement); - } } return false; @@ -180,8 +179,8 @@ async function drawWithPauses() { candidate = drawElement[1]; if (candidate == "0") document.getElementById(position).innerHTML = ""; // remove candidate from grid - else // draw the candidate - document.getElementById(position).innerHTML = candidate; + else + document.getElementById(position).innerHTML = candidate; // draw the candidate await sleep(1); } enableGenerateButton(); @@ -205,11 +204,6 @@ function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } -function disableButtons() { - disableGenerateButton(); - disableSolveButton(); -} - function createNewGenerationMessage() { if (takesTooLongToExecute) { console.log(drawGrid.length); @@ -227,6 +221,11 @@ function emptyMessages() { document.getElementById("messages").innerHTML = ""; } +function disableButtons() { + disableGenerateButton(); + disableSolveButton(); +} + function disableGenerateButton() { document.getElementsByClassName("generateButton")[0].disabled = true; }