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 · Games and state

CARD_GAME_TABLESconstant

Every game's table: the fewest, the most and the usual number of players, the lengths of game offered and the usual one.

Import it

import { CARD_GAME_TABLES } from "@johnmorrisdotca/toranpu";

Definition

const CARD_GAME_TABLES: Record<CardGameKind, CardGameTable> = {
    hearts: { fewestPlayers: 3, mostPlayers: 4, defaultPlayers: 4, sizes: [HEARTS_SIZES.short, HEARTS_SIZES.full], defaultSize: HEARTS_SIZES.full },
    bigTwo: { fewestPlayers: 2, mostPlayers: 4, defaultPlayers: 4, sizes: BIG_TWO_DEALS, defaultSize: 3 },
    president: { fewestPlayers: 3, mostPlayers: 8, defaultPlayers: 4, sizes: PRESIDENT_ROUNDS, defaultSize: 3 },
    goFish: { fewestPlayers: 2, mostPlayers: 6, defaultPlayers: 3, sizes: GO_FISH_SIZES, defaultSize: 1 },
    crazyEights: { fewestPlayers: 2, mostPlayers: 7, defaultPlayers: 3, sizes: CRAZY_EIGHTS_SIZES, defaultSize: 100 },
    spades: { fewestPlayers: 4, mostPlayers: 4, defaultPlayers: 4, sizes: SPADES_SIZES, defaultSize: 500 },
    ginRummy: { fewestPlayers: 2, mostPlayers: 2, defaultPlayers: 2, sizes: GIN_SIZES, defaultSize: 100 },
    euchre: { fewestPlayers: 4, mostPlayers: 4, defaultPlayers: 4, sizes: EUCHRE_SIZES, defaultSize: 10 },
    cribbage: { fewestPlayers: 2, mostPlayers: 2, defaultPlayers: 2, sizes: CRIBBAGE_SIZES, defaultSize: 121 },
    ohHell: { fewestPlayers: 3, mostPlayers: 4, defaultPlayers: 4, sizes: OH_HELL_DEALS, defaultSize: 13 },
    war: { fewestPlayers: 2, mostPlayers: 2, defaultPlayers: 2, sizes: WAR_ROUNDS, defaultSize: 100 },
}

Members

NameTypeDescription
spadesCardGameTable
heartsCardGameTable
bigTwoCardGameTable
presidentCardGameTable
goFishCardGameTable
crazyEightsCardGameTable
ginRummyCardGameTable
euchreCardGameTable
cribbageCardGameTable
ohHellCardGameTable
warCardGameTable

Examples

import { CARD_GAME_TABLES } from "@johnmorrisdotca/toranpu";
console.log(Object.keys(CARD_GAME_TABLES));
[
  'hearts',      'bigTwo',
  'president',   'goFish',
  'crazyEights', 'spades',
  'ginRummy',    'euchre',
  'cribbage',    'ohHell',
  'war'
]

What it prints (run when this page was built)

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