fast-sudoku-solver
Version:
A fast Sudoku solver written in TypeScript.
14 lines (13 loc) • 853 B
TypeScript
import { NextNumberResult } from '../index';
/**
* Calculates the next number for the specified Sudoku puzzle.
* The function returns whether the puzzle *isSolvable*, and it returns the *row*, the *column*, and the *entry* itself for the next number.
*
* In particular, the function returns the entry for the field with the fewest number of possible entries.
* For instance, if there is a field with 7 possible entries and another field with only 2 possible entries, a correct entry for the latter is returned.
*
* **NOTE:** If the Sudoku puzzle is already completely solved, this function returns value -1 for *row*, *column*, and *entry*.
* @param sudoku the Sudoku puzzle for which the next entry should be calculated
* @returns the entry for the next field
*/
export declare function solveNextNumber(sudoku: number[][]): NextNumberResult;