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

canReachfunction

Whether the remaining distinct digits can reach the target sum in the given slots.

Import it

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

Also exported from: @johnmorrisdotca/kazu

Definition

function canReach(target: number, slots: number, used: readonly number[]): boolean

Parameters

NameTypeDescription
targetnumber

The required digit total still to reach.

slotsnumber

The number of remaining distinct digits.

usedreadonly number[]

Digits already used in this run.

Returns

boolean

Whether the remaining distinct digits can reach the target sum in the given slots.

Examples

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

console.log(canReach(10,2,[1]));
true

What it prints (run when this page was built)

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