本文へ移動

Toranpuトランプ

デッキを使い、11種類のゲームでコンピューターと対戦し、ソリティアを解いたり、独自の絵柄でカードを表示したりできます。

「トランプ」は、日本語で playing cards を指す言葉です。 名前について(英語)

目次

リファレンス · フリーセル

solveFreeCell関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

A winning line from this table — every move a replay of it makes, the safe ones home included — or null when none was found within budget tables. Best first (bestFirst): the table that looks nearest to won is opened next.

インポート

import { solveFreeCell } from "@johnmorrisdotca/toranpu/freecell";

定義

function solveFreeCell(start: FreeCellTable, budget?: number): { moves: FreeCellMove[] | null; tables: number; }

引数

名前型説明
startFreeCellTable

The initial game or state before the recorded moves.

budget (省略可)number

Limits on the solver’s search work.

戻り値

{ moves: FreeCellMove[] | null; tables: number; }

A winning line from this table — every move a replay of it makes, the safe ones home included — or null when none was found within budget tables. Best first (bestFirst): the table that looks nearest to won is opened next.

例

import { dealFreeCell, dealOfSeed, deckOf, solveFreeCell } from "@johnmorrisdotca/toranpu/freecell";

const table = dealFreeCell(deckOf(dealOfSeed(42))!, 4);
console.log(solveFreeCell(table, 100));

ソースを見るGitHub で編集@johnmorrisdotca/toranpu 2.15.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。