本文へ移動

Kazu数

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

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

目次

リファレンス · 美術館の規則

rateAkari関数

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

Rates a board by solving it as a person would: with the rules alone (depth 0), then with one supposition at a time (depth 1), and anything beyond that is depth 2. A board with no single answer cannot be rated.

インポート

import { rateAkari } from "@johnmorrisdotca/kazu/akari";

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

定義

function rateAkari(board: AkariBoard): AkariRating

引数

名前型説明
boardAkariBoard

The valid native board with its printed clues and dimensions.

戻り値

AkariRating

Rates a board by solving it as a person would: with the rules alone (depth 0), then with one supposition at a time (depth 1), and anything beyond that is depth 2. A board with no single answer cannot be rated.

例

import type { AkariBoard } from "@johnmorrisdotca/kazu/akari";
import { rateAkari } from "@johnmorrisdotca/kazu/akari";

const akariBoard: AkariBoard = {"width":5,"height":5,"cells":[1,null,null,null,null,0,null,null,null,0,1,0,null,null,null,null,false,null,null,null,null,false,null,null,2]};
console.log(rateAkari(akariBoard));
{
  depth: 0,
  probes: 0,
  whites: 17,
  blacks: 8,
  clues: 6,
  bulbs: 5,
  clueShare: 0.75,
  openShare: 0.68
}

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

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

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