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 · Gin Rummy

deadwoodOffunction

What a list of cards counts as deadwood, added up.

Import it

import { deadwoodOf } from "@johnmorrisdotca/toranpu/gin-rummy";

Definition

function deadwoodOf(cards: readonly CardId[]): number

Parameters

NameTypeDescription
cardsreadonly string[]

The cards in their current order.

Returns

number

What a list of cards counts as deadwood, added up.

Examples

import { deadwoodOf } from "@johnmorrisdotca/toranpu/gin-rummy";

console.log(deadwoodOf(["AS", "KS"]));
11

What it prints (run when this page was built)

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