Skip to content

Instantly share code, notes, and snippets.

View danibrear's full-sized avatar
🤓
Nerdin' out

Danielle "Dani" Brear danibrear

🤓
Nerdin' out
View GitHub Profile
function sudoku(puzzle) {
if (solved(puzzle)) {
return puzzle;
}
var copy = puzzle.slice(0);
for(var x=0;x<9; x++) {
for(var y=0;y<9;y++) {
if (puzzle[x][y] !== 0) continue;
var available = get_available(puzzle, x,y);
for(var i = 0; i < available.length;i++) {