1.0.7 • Published 6 years ago

@jlguenego/sudoku-generator v1.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
6 years ago

sudoku-generator

Sudoku generator and carving

Install

npm install @jlguenego/sudoku-generator

Use

Generating a sudoku solution

const { SudokuSolver } = require('@jlguenego/sudoku-generator');

const grid = SudokuSolver.generate();

Carving a sudoku solution

const { SudokuSolver } = require('@jlguenego/sudoku-generator');

const grid = SudokuSolver.generate();
// remove 55 cases while insuring there is one and only one solution.
const grid2 = SudokuSolver.carve(grid, 55);

Test

For running the automated test, just run:

npm test

If you decide to improve this software, just make a pull request with everything tested with mocha.

Implementation details

Source code written in Typescript.

Class SudokuSolver

The generate method uses backtracking technics.

The carve method also uses backtracking technics and some tricks that human do just do speed up the process.

#Licence

ISC 2018 Jean-Louis GUENEGO

Authors

Jean-Louis GUENEGO

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago