AkariRating型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
How hard a board is, measured by solving it. depth 0 means the plain rules solve it, 1 means somebody has to
suppose a bulb or an empty square and see it break, 2 means more than that. probes is how many suppositions
the depth-1 reasoning needed. The rest describes the board.
インポート
import type { AkariRating } from "@johnmorrisdotca/kazu/akari";
ほかのエクスポート元: @johnmorrisdotca/kazu
定義
type AkariRating = {
depth: 0 | 1 | 2;
probes: number;
whites: number;
blacks: number;
clues: number;
bulbs: number;
clueShare: number;
openShare: number;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
depth | 0 | 1 | 2 | |
probes | number | |
whites | number | |
blacks | number | |
clues | number | |
bulbs | number | |
clueShare | number | Numbered squares as a share of the black squares that touch a white one. |
openShare | number | White squares as a share of the board. |
例
import type { AkariBoard, AkariRating } 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]};
const value: AkariRating = rateAkari(akariBoard);
console.log(value);{
depth: 0,
probes: 0,
whites: 17,
blacks: 8,
clues: 6,
bulbs: 5,
clueShare: 0.75,
openShare: 0.68
}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。