本文へ移動

Toranpuトランプ

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

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

目次

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

replayFreeCell関数

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

A game played out from its deal: every table it passed through, the first the deal, or null where the deal is not a deck or a move is one the rules refuse. The one reader of a move list, for the table, a kept run, the check and a finished game's page alike.

インポート

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

定義

function replayFreeCell(deal: string, cells: number, moves: string): FreeCellTable[] | null

引数

名前型説明
dealstring

The deal number or dealing specification.

cellsnumber

The number of available free cells.

movesstring

The ordered native moves to replay.

戻り値

FreeCellTable[] | null

A game played out from its deal: every table it passed through, the first the deal, or null where the deal is not a deck or a move is one the rules refuse. The one reader of a move list, for the table, a kept run, the check and a finished game's page alike.

例

import { dealFreeCell, dealOfSeed, deckOf, encodeMoves, movesFrom, replayFreeCell } from "@johnmorrisdotca/toranpu/freecell";

const table = dealFreeCell(deckOf(dealOfSeed(42))!, 4);
console.log(replayFreeCell(dealOfSeed(42), 4, encodeMoves(movesFrom(table).slice(0, 1)))?.length);
2

出力(このページを作ったときに実行した結果)

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

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