1.1.2 • Published 1 year ago

killer-sudoku-generator v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Killer Sudoku Generator

Install

npm i killer-sudoku-generator

Usage

import { 
    generateKillerSudoku, 
    getSeparationsFromAreas,
} from "killer-sudoku-generator";

const sudoku = generateKillerSudoku();

const { puzzle, solution, areas, difficulty } = sudoku;

const { verticalSeparations, horizontalSeparations } = getSeparationsFromAreas(areas);

Details

The function generateKillerSudoku takes an optional parameter difficulty which must be between easy, hard, medium and expert.

You can customize the number of cells each difficulty removes from the full solution with the overrideNumberOfCellsToRemove function like this:

import { 
    generateKillerSudoku, 
    overrideNumberOfCellsToRemove
} from "killer-sudoku-generator";

overrideNumberOfCellsToRemove("easy", 15)

const sudoku = generateKillerSudoku("easy");

By default, the numbers of cells to remove for each difficulty are:

{
    "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.

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago