本文へ移動

Kazu数

検証済みの数独や論理パズルを作り、標準の規則とヒントを読み、盤を描いたり埋め込んだりできます。

「数」は数字を表す言葉です。 名前について(英語)

目次

リファレンス · カックロの規則

canReach関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

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

インポート

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

ほかのエクスポート元: @johnmorrisdotca/kazu

定義

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

引数

名前型説明
targetnumber

The required digit total still to reach.

slotsnumber

The number of remaining distinct digits.

usedreadonly number[]

Digits already used in this run.

戻り値

boolean

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

例

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

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

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/kazu 2.1.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。