LoopRating型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
How hard a board is, measured by solving it. depth 0 means the plain rules solve it, 1 that somebody has to
suppose an edge drawn or crossed and watch it break, 2 that more than that is needed; probes is how many
suppositions depth 1 needed. The rest describes the board.
インポート
import type { LoopRating } from "@johnmorrisdotca/kazu/loop";
ほかのエクスポート元: @johnmorrisdotca/kazu
定義
type LoopRating = {
depth: 0 | 1 | 2;
probes: number;
clues: number;
clueShare: number;
zeroShare: number;
loop: number;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
depth | 0 | 1 | 2 | |
probes | number | |
clues | number | |
clueShare | number | Numbered squares as a share of all squares. |
zeroShare | number | Squares numbered 0 as a share of the numbered ones. |
loop | number | Edges in the loop. |
例
import type { LoopBoard, LoopRating } from "@johnmorrisdotca/kazu/loop";
import { rateLoop } from "@johnmorrisdotca/kazu/loop";
const loopBoard: LoopBoard = {"width":5,"height":5,"clues":[2,3,1,null,null,3,1,1,null,null,3,2,2,null,null,3,0,2,2,null,2,2,1,2,3]};
const value: LoopRating = rateLoop(loopBoard);
console.log(value);{
depth: 0,
probes: 0,
clues: 18,
clueShare: 0.72,
zeroShare: 0.05555555555555555,
loop: 22
}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。