Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shiyan7/sudoku-toolbox
Utilities for creating solving and other functions of Sudoku
https://github.com/shiyan7/sudoku-toolbox
generator npm-package solving sudoku utils
Last synced: 24 days ago
JSON representation
Utilities for creating solving and other functions of Sudoku
- Host: GitHub
- URL: https://github.com/shiyan7/sudoku-toolbox
- Owner: Shiyan7
- License: mit
- Created: 2023-09-18T09:31:20.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-09-23T19:39:28.000Z (about 1 year ago)
- Last Synced: 2024-10-11T22:24:24.103Z (26 days ago)
- Topics: generator, npm-package, solving, sudoku, utils
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/sudoku-toolbox
- Size: 46.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sudoku toolbox
## Install
```
yarn add sudoku-toolbox
```## Usage
```js
import { generateSudoku } from "sudoku-toolbox";const sudoku = generateSudoku();
const { puzzle, solution, areas, difficulty } = sudoku;
```## Details
The function `generateSudoku` takes an optional parameter `difficulty` which must be between `easy`, `hard`, `medium` and `expert`.
```js
import { generateSudoku } from "sudoku-toolbox";const sudoku = generateSudoku("easy");
```By default, the numbers of cells to remove for each difficulty are:
```js
{
"easy": 30,
"medium": 40,
"hard": 50,
"expert": 60,
}
```From experience, above 67 or 68 numbers to remove, the program begins to struggle and is a bit slow and it is possible that it can hang forever above 70.
In an upcoming version, it will just raise an error after a timeout.