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

GinLayouttype

Each hand's player, laid out: their melds, and the cards left over.

Import it

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

Definition

type GinLayout = {
    melds: GinMeld[];
    deadwood: CardId[];
};

Members

NameTypeDescription
meldsGinMeld[]
deadwoodstring[]

Examples

import type { GinLayout } from "@johnmorrisdotca/toranpu/gin-rummy";
import { bestLayout } from "@johnmorrisdotca/toranpu/gin-rummy";

const value: GinLayout = bestLayout(["3H", "4H", "5H", "AS"]);
console.log(value.deadwood);
[ 'AS' ]

What it prints (run when this page was built)

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