1.0.0 • Published 5 years ago
@jemo/sudoku v1.0.0
Sudoku Resolving Library
This library can be used for solving "Sudoku" quizzes. The board size must be a square number: 1, 4, 9, 16, 25 and so on.
Quick Start
// Get up to 10 solutions of a 9x9 sudoku
import {Boad} fron 'sudoku';
//Note, that You must write one more comma at the end of a row,
//if the last number in row is not defined.
let board= Board.setBoard([
[6, , ,2,8, ,5,1,,],
[4, , , , , , , ,,],
[8,2, ,5, , ,9, ,,],
[9,1,3, ,5, ,4, ,7],
[ , ,8, , , ,3, ,,],
[ ,4, , ,9,2, , ,,],
[3, , ,4, , ,2, ,,],
[ ,5, , , , , , ,,],
[ , , ,8, ,6, , ,,]
]);
let solutions = board.resolve(10)
console.log(solutions.toString());
// Get up to 3 solutions of a 4x4 sudoku
import {Boad} fron 'sudoku';
let board= Board.setBoard([
[6, , ,2],
[ , , ,,],
[ , , ,,],
[ , , ,,]
]);
let solutions = board.resolve(3)
console.log(solutions.toString());
1.0.0
5 years ago