SolveResult型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What the solver found.
インポート
import type { SolveResult } from "@johnmorrisdotca/suido";
定義
type SolveResult = {
count: number;
solutions: number[][];
nodes: number;
branches: number;
forced: number;
complete: boolean;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
count | number | How many answers there are, counted up to the limit asked for. |
solutions | number[][] | Each answer found, as the sides every piece opens on. In a drains board a piece the water does not reach stays as it was given. |
nodes | number | The positions the search looked at, and how many of them had more than one way on to try. |
branches | number | |
forced | number | The pieces fixed by deduction alone, before the search had to guess anything. |
complete | boolean | False when the budget ran out before the search was finished: |
例
import { SUIDO_5X5 } from "@johnmorrisdotca/suido/levels-5x5";
import { decodeLayout, solve } from "@johnmorrisdotca/suido";
import type { SolveResult } from "@johnmorrisdotca/suido";
const row = SUIDO_5X5[0];
const code = row[0];
const layout = decodeLayout(code)!;
const value: SolveResult = solve(layout,2,20000);
console.log(value);{
count: 1,
solutions: [
[
6, 10, 10, 10, 8, 5, 2, 10,
12, 4, 7, 14, 10, 15, 13, 5,
3, 8, 1, 5, 3, 10, 10, 8,
1
]
],
nodes: 1,
branches: 0,
forced: 25,
complete: true
}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。