Class SudokuSolver
Defined in: SudokuSolver.js.
Constructor Attributes  Constructor Name and Description 

Applies the dancinglinks network to solve Sudoku problems.

Method Attributes  Method Name and Description 

fix(selection, cellNo, an)
Sets some numbers in a sudoku grid to be fixed.


showBoard(str)
Adds line breaks and other characters into a string to show sudoku boards in a slightly nicer way.


solve(puzzle, maxSolutions, maxTime)
Solves a puzzle passed in in a string format, with .

Method Detail
fix(selection, cellNo, an)
Sets some numbers in a sudoku grid to be fixed.
 Parameters:
 {number} selection
 the value that is in fixed in the sudoku problem. Must be 19.
 {number} cellNo
 the number of the cell that is fixed to this value. Must be 080.
 {CircularList[]} an
 array to which is added any nodes that were hidden during this fixing. this is so that a number of fixing operations can easily be reversed after solving this puzzle.
showBoard(str)
Adds line breaks and other characters into a string to show sudoku boards in a slightly nicer way.
 Parameters:
 {String} str
 a string representation of a sudoku board.
solve(puzzle, maxSolutions, maxTime)
Solves a puzzle passed in in a string format, with ., 0 or space indicating unfilled squares.
e.g.
".6.3..8.4537.9.....4...63.7.9..51238.........71362..4.3.64...1.....6.5231.2..9.8."
 Parameters:
 {String} puzzle
 a string representation of a sudoku puzzle. May not be null.
 {number} maxSolutions Optional
 the maximum number of solutions to find. Will attempt to find all solutions if not set.
 {number} maxTime Optional
 the maximum time in milliseconds to spend looking for solutions. Will not have a time limit if not set.