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

wantedfunction

Whether the discard would go straight into a meld: the hand with it and its best throw has less deadwood than now.

Import it

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

Definition

function wanted(hand: readonly CardId[], card: CardId): boolean

Parameters

NameTypeDescription
handreadonly string[]

The player’s held cards, or the hand number for a deal.

cardstring

The physical card or card id to read, draw or play.

Returns

boolean

Whether the discard would go straight into a meld: the hand with it and its best throw has less deadwood than now.

Examples

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

console.log(wanted(["3H", "4H"], "5H"));
false

What it prints (run when this page was built)

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