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

meldsInfunction

Every meld that can be made from these cards: each set of three or four, and each run of three or more.

Import it

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

Definition

function meldsIn(hand: readonly CardId[]): GinMeld[]

Parameters

NameTypeDescription
handreadonly string[]

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

Returns

GinMeld[]

Every meld that can be made from these cards: each set of three or four, and each run of three or more.

Examples

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

console.log(meldsIn(["3H", "4H", "5H", "AS"]));
[ [ '3H', '4H', '5H' ] ]

What it prints (run when this page was built)

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