generateShikakufunction
Seeded rectangles packed into the board, one number each, with an independently counted, unique answer. The board is rated by solving it: easy by the first two rules (a number with one fitting rectangle, a square one rectangle can cover), medium once the third rule is needed too, hard by supposing, extra-hard the most-supposing of several boards. If no board of the level is found within the attempts the next level down is tried, and the first generator is the last resort.
Import it
import { generateShikaku } from "@johnmorrisdotca/kazu/shikaku";
Also exported from: @johnmorrisdotca/kazu
Definition
function generateShikaku(width?: number, height?: number, level?: ShikakuLevel, seed?: number): ShikakuPuzzle
Parameters
| Name | Type | Description |
|---|---|---|
width (optional) | number | The supported board width in cells. |
height (optional) | number | The supported board height in cells. |
level (optional) | ShikakuLevel | The requested native difficulty tier. |
seed (optional) | number | The reproducible native puzzle seed. |
Returns
ShikakuPuzzle
Seeded rectangles packed into the board, one number each, with an independently counted, unique answer. The board is rated by solving it: easy by the first two rules (a number with one fitting rectangle, a square one rectangle can cover), medium once the third rule is needed too, hard by supposing, extra-hard the most-supposing of several boards. If no board of the level is found within the attempts the next level down is tried, and the first generator is the last resort.
Examples
import { generateShikaku } from "@johnmorrisdotca/kazu/shikaku";
console.log(generateShikaku(5,5,"easy",42));