Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bblodfon committed Dec 18, 2016
1 parent f85cf86 commit 1943333
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
28 changes: 14 additions & 14 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}

1 change: 0 additions & 1 deletion sudokuSolver.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,5 @@
<div id="messages">
</div>
</div>

</body>
</html>
15 changes: 7 additions & 8 deletions sudokuSolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ function solveUsingBacktrack() {
//removeCandidateFromGrid(positionOfCandidate);
drawElement = [positionOfCandidate,"0"];
drawGrid.push(drawElement);

}
}
return false;
Expand All @@ -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();
Expand All @@ -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);
Expand All @@ -227,6 +221,11 @@ function emptyMessages() {
document.getElementById("messages").innerHTML = "";
}

function disableButtons() {
disableGenerateButton();
disableSolveButton();
}

function disableGenerateButton() {
document.getElementsByClassName("generateButton")[0].disabled = true;
}
Expand Down

0 comments on commit 1943333

Please sign in to comment.