ss

@mattflow/sudoku-solver

Simple, lightweight sudoku solver.

Showing:

Popularity

Downloads/wk

45

GitHub Stars

3

Maintenance

Last Commit

5mos ago

Contributors

0

Package

Dependencies

0

Size (min+gzip)

0.7KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Sudoku Solver

Simple, fast sudoku solver.

See it in action here: mattflow.github.io/sudoku-solver

Build Status Coverage Status

Installation

npm install --save @mattflow/sudoku-solver

or

yarn add @mattflow/sudoku-solver

Simple Usage

Accepts a string or array of 81 elements with 0 representing an empty box.

Returns a string containing the solved puzzle.

var solve = require('@mattflow/sudoku-solver');
var puzzle = '000001200100700045000430700090006300050807020006200090003019000970004006002500000';
var solution = solve(puzzle);
console.log(solution);
// 745981263138762945629435718297156384354897621816243597583619472971324856462578139

solve(puzzle, options)

puzzle: A string or array of 81 elements with 0 representing an empty box.

options: An optional object containing configurations.

  • emptyValue: Value representing an empty box. Default: '0'
  • hintCheck: Boolean determining if a hint check is performed. Default: true
  • outputArray: Boolean determining if an array is returned instead of a string. Default: false
  • maxIterations: Value determining the maximum number of iterations before exiting. 0 to disable. Default: 1000000

Running Tests

npm test

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100