Skip to the content

Toranpuトランプ

Use a deck, play eleven games with computers, solve a solitaire, or display cards in your own design.

Toranpu is Japanese for playing cards. About the name

Contents

Reference · FreeCell

freeCellLiftablefunction

The cards a person can take hold of from a spot, the one held and every one on it, or none: a free cell's card, or a column's card with the run in order on top of it. A foundation's cards stay home.

Import it

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

Definition

function freeCellLiftable(table: FreeCellTable, spot: FreeCellSpot): readonly number[]

Parameters

NameTypeDescription
tableFreeCellTable

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

spotFreeCellSpot

The source or destination card location.

Returns

readonly number[]

The cards a person can take hold of from a spot, the one held and every one on it, or none: a free cell's card, or a column's card with the run in order on top of it. A foundation's cards stay home.

Examples

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

const table = dealFreeCell(deckOf(dealOfSeed(42))!, 4);
console.log(freeCellLiftable(table, { pile: "1", index: table.tableau[0]!.length - 1 }));
[ 32 ]

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/toranpu 2.15.0.