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

runLengthfunction

How many cards on top of a column are in order, each on the one under it: the most a single carry could ever take.

Import it

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

Definition

function runLength(column: readonly number[]): number

Parameters

NameTypeDescription
columnreadonly number[]

The column index, or its bottom-to-top cards where an array is accepted.

Returns

number

How many cards on top of a column are in order, each on the one under it: the most a single carry could ever take.

Examples

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

console.log(runLength([4, 16]));
2

What it prints (run when this page was built)

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