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
引数
| 名前 | 型 | 説明 |
|---|---|---|
board | AkariBoard | 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
}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。