本文へ移動

Toranpuトランプ

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

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

目次

リファレンス · スパイダー

spiderMoveFor関数

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

The move that carries the cards held at from onto the column to, if the rules allow exactly those cards there.

インポート

import { spiderMoveFor } from "@johnmorrisdotca/toranpu/spider";

定義

function spiderMoveFor(table: SpiderTable, from: SpiderSpot, to: string): SpiderMove | null

引数

名前型説明
tableSpiderTable

The native solitaire table; move helpers leave the input unchanged.

fromSpiderSpot

The source position or source state specified by this API.

tostring

The destination position or state specified by this API.

戻り値

SpiderMove | null

The legal run carry, or null when the selected run cannot move onto that column.

例

import { dealSpider, spiderDealOfSeed, spiderDeckOf, spiderMoveFor } from "@johnmorrisdotca/toranpu/spider";

const table = dealSpider(spiderDeckOf(spiderDealOfSeed(42, 1), 1)!);
console.log(spiderMoveFor(table, { pile: "0", index: table.tableau[0]!.cards.length - 1 }, "1"));
null

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

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

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