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

GinResulttype

How a hand ended: who scored and how much, and how each hand was laid down.

Import it

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

Definition

type GinResult = {
    knocker: number | null;
    winner: number | null;
    points: number;
    kind: "gin" | "knock" | "undercut" | "drawn";
    layouts: GinLayout[];
    laidOff: CardId[];
};

Members

NameTypeDescription
knockernumber | null

The seat that knocked, or null for a hand drawn with the stock run down.

winnernumber | null

The seat that scored the hand, or null for none.

pointsnumber
kind"gin" | "knock" | "undercut" | "drawn"

"gin" with no deadwood, "knock" won, "undercut" when the other player had no more, "drawn" when the stock ran out.

layoutsGinLayout[]

Each seat's melds and deadwood as scored, after the other player laid off onto a knocker's melds.

laidOffstring[]

The cards the defender laid off onto the knocker's melds.

Examples

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

const value: GinResult = { knocker: null, winner: null, points: 0, kind: "drawn", layouts: [], laidOff: [] };
console.log(value.kind);
drawn

What it prints (run when this page was built)

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