Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
mattflow committed Apr 10, 2017
2 parents 98ade8d + f153f94 commit 9588632
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ function validate(board) {

// Returns a deep copy of a board
function copy(board) {
let ret = [];
let copy = [];
let emptyBoxes = 0;
for (let i = 0; i < board.length; i++) {
ret.push(Number(board[i]));
if (ret[i] === 0)
copy.push(Number(board[i]));
if (copy[i] === 0)
emptyBoxes++;
if (emptyBoxes > 64)
throw 'A board must have at least 17 hints';
}
return ret;
return copy;
}

// Recursive function that accepts a unsolved puzzle and
Expand Down

0 comments on commit 9588632

Please sign in to comment.