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

mostCarriedfunction

The most cards a carry may take, as though moved one at a time: one more than the empty free cells, doubled for every empty column but the one the cards are going to.

Import it

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

Definition

function mostCarried(table: FreeCellTable, toEmptyColumn: boolean): number

Parameters

NameTypeDescription
tableFreeCellTable

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

toEmptyColumnboolean

Whether the destination tableau column is empty.

Returns

number

The most cards a carry may take, as though moved one at a time: one more than the empty free cells, doubled for every empty column but the one the cards are going to.

Examples

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

const table = dealFreeCell(deckOf(dealOfSeed(42))!, 4);
console.log(mostCarried(table, false));
5

What it prints (run when this page was built)

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