Solution型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Bounded search result; limit distinguishes unfinished search from proof.
インポート
import type { Solution } from "@johnmorrisdotca/tobiishi";
定義
type Solution = {
status: "solved" | "impossible" | "limit";
jumps: Jump[];
visited: number;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
status | "solved" | "impossible" | "limit" | |
jumps | Readonly<{ from: number; over: number; to: number; }>[] | |
visited | number |
例
import { makeBoard, newGame, solve } from "@johnmorrisdotca/tobiishi";
import type { Solution } from "@johnmorrisdotca/tobiishi";
const board = makeBoard("Three holes",[{x:0,y:0},{x:1,y:0},{x:2,y:0}]);
const game = newGame(board,[true,true,false],2);
const value: Solution = solve(game,100);
console.log(value);{
status: 'solved',
jumps: [ { from: 0, over: 1, to: 2 } ],
visited: 1
}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。