Skip to the content

Kazu数

Generate checked Sudoku and logic puzzles, read native rules and hints, and draw or embed playable boards.

Kazu is the Japanese word 数 for number. About the name

Contents

Reference · Cross Sums rules

generateCrossSumsfunction

Makes a seeded board of size squares a side (counting the row and column of totals) and proves it has one answer. A random pattern of black squares sets the runs, random digits fill them, and digits are changed until the answer is single. The board is then rated by solving it: easy by the single-run rules, medium once a digit that must appear has to be traced, hard by supposing, and 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 (a 10×10 only) is the last resort, so a seed never throws.

Import it

import { generateCrossSums } from "@johnmorrisdotca/kazu/cross-sums";

Also exported from: @johnmorrisdotca/kazu

Definition

function generateCrossSums(seed?: number, level?: CrossSumsLevel, size?: number): CrossSumsPuzzle

Parameters

NameTypeDescription
seed (optional)number

The reproducible native puzzle seed.

level (optional)CrossSumsLevel

The requested native difficulty tier.

size (optional)number

The supported square board side length.

Returns

CrossSumsPuzzle

Makes a seeded board of size squares a side (counting the row and column of totals) and proves it has one answer. A random pattern of black squares sets the runs, random digits fill them, and digits are changed until the answer is single. The board is then rated by solving it: easy by the single-run rules, medium once a digit that must appear has to be traced, hard by supposing, and 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 (a 10×10 only) is the last resort, so a seed never throws.

Examples

import { generateCrossSums } from "@johnmorrisdotca/kazu/cross-sums";

console.log(generateCrossSums(42,"easy",5));

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kazu 2.1.0.