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
| Name | Type | Description |
|---|---|---|
knocker | number | null | The seat that knocked, or null for a hand drawn with the stock run down. |
winner | number | null | The seat that scored the hand, or null for none. |
points | number | |
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. |
layouts | GinLayout[] | Each seat's melds and deadwood as scored, after the other player laid off onto a knocker's melds. |
laidOff | string[] | 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);drawnWhat it prints (run when this page was built)