JASSL
(WIP) Just Another Sudoku Solving Library
About
JASSL aims to be a sudoku solving companion library. In the simplest use-case it functions as a mere puzzle validator and cell tracker but has capabilities to completely solve most sudoku puzzles
Install
npm install --save jassl
API Overview
Create a new puzzle instance
// import librarylet SudokuPuzzle = ; // empty list of values for the puzzlelet puzzleValues = Array81; // create sudoku instance: defaults to 9x9 with 9 3x3 sectorslet sudoku = puzzleValues;
Create puzzle instance with non-traditional sector size
// empty list of values for the puzzlelet puzzleValues = Array10 * 10; // creates a 10x10 with 10 5x2 sectorslet sudoku = puzzleValues sectorWidth: 5 sectorHeight: 2;
Attempt to solve puzzle
// returns true if the puzzle was fully solvedlet solved = sudoku;
External Solve attempt
try sudokucells0; // invalid solution for cell catch e console;
Retrieving applicable candidates
// for a celllet cellCandidates = sudokucells0candidates; // For a rowlet rowCandidates = sudokurows0candidates; // For a columnlet columnCandidates = sudokucolumns0candidates; // For a sectorlet sectorCandidates = sudokusector0candidates;