2.2.0 • Published 5 years ago

@mattflow/sudoku-solver v2.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

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

2.2.0

5 years ago

2.1.3

6 years ago

2.1.2

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago