本文へ移動

Kazu数

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

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

目次

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

CrossSumsRating型

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

How hard a board is, measured by solving it. depth 0 means the rules solve it, 1 that somebody has to suppose a digit and watch it break, 2 that more than that is needed; plain says the single-run rules were enough (no digit that must appear had to be traced). probes is how many suppositions depth 1 needed. The rest describes the runs.

インポート

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

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

定義

type CrossSumsRating = {
    depth: 0 | 1 | 2;
    plain: boolean;
    probes: number;
    whites: number;
    runs: number;
    longest: number;
    meanRun: number;
    fixedShare: number;
};

メンバー

名前型説明
depth0 | 1 | 2
plainboolean
probesnumber
whitesnumber
runsnumber
longestnumber
meanRunnumber

Mean number of squares in a run.

fixedSharenumber

Runs whose total can be made in only one way, as a share of the runs.

例

import type { CrossSumsBoard, CrossSumsRating } from "@johnmorrisdotca/kazu/cross-sums";
import { rateCrossSums } from "@johnmorrisdotca/kazu/cross-sums";

const crossSumsBoard: CrossSumsBoard = {"width":5,"height":5,"cells":[{"kind":"black","across":null,"down":null},{"kind":"black","across":null,"down":null},{"kind":"black","across":null,"down":10},{"kind":"black","across":null,"down":7},{"kind":"black","across":null,"down":12},{"kind":"black","across":null,"down":null},{"kind":"black","across":6,"down":null},{"kind":"white"},{"kind":"white"},{"kind":"white"},{"kind":"black","across":null,"down":null},{"kind":"black","across":23,"down":null},{"kind":"white"},{"kind":"white"},{"kind":"white"},{"kind":"black","across":null,"down":null},{"kind":"black","across":null,"down":null},{"kind":"black","across":null,"down":null},{"kind":"black","across":null,"down":null},{"kind":"black","across":null,"down":null},{"kind":"black","across":null,"down":null},{"kind":"black","across":null,"down":null},{"kind":"black","across":null,"down":null},{"kind":"black","across":null,"down":null},{"kind":"black","across":null,"down":null}]};
const value: CrossSumsRating = rateCrossSums(crossSumsBoard);
console.log(value);
{
  depth: 0,
  plain: true,
  probes: 0,
  whites: 6,
  runs: 5,
  longest: 3,
  meanRun: 2.4,
  fixedShare: 0.4
}

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

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

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