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_RULESconstant

EVERY CARD GAME'S RULES, by kind: what a table plays and what the simulation plays out. A mapped type, so a new card game does not compile until its rules are here.

Import it

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

Definition

const CARD_GAME_RULES: { spades: CardGameRules<SpadesGame, SpadesMove>; hearts: CardGameRules<HeartsGame, HeartsMove>; bigTwo: CardGameRules<BigTwoGame, ClimbMove>; president: CardGameRules<PresidentGame, PresidentMove>; goFish: CardGameRules<GoFishGame, GoFishMove>; crazyEights: CardGameRules<CrazyEightsGame, CrazyEightsMove>; ginRummy: CardGameRules<GinGame, GinMove>; euchre: CardGameRules<EuchreGame, EuchreMove>; cribbage: CardGameRules<CribbageGame, CribbageMove>; ohHell: CardGameRules<OhHellGame, OhHellMove>; war: CardGameRules<WarGame, WarMove>; } = {
    hearts: HEARTS_RULES,
    bigTwo: BIG_TWO_RULES,
    president: PRESIDENT_RULES,
    goFish: GO_FISH_RULES,
    crazyEights: CRAZY_EIGHTS_RULES,
    spades: SPADES_RULES,
    ginRummy: GIN_RUMMY_RULES,
    euchre: EUCHRE_RULES,
    cribbage: CRIBBAGE_RULES,
    ohHell: OH_HELL_RULES,
    war: WAR_RULES,
}

Members

NameTypeDescription
spadesCardGameRules<SpadesGame, SpadesMove>
heartsCardGameRules<HeartsGame, HeartsMove>
bigTwoCardGameRules<BigTwoGame, ClimbMove>
presidentCardGameRules<PresidentGame, PresidentMove>
goFishCardGameRules<GoFishGame, GoFishMove>
crazyEightsCardGameRules<CrazyEightsGame, CrazyEightsMove>
ginRummyCardGameRules<GinGame, GinMove>
euchreCardGameRules<EuchreGame, EuchreMove>
cribbageCardGameRules<CribbageGame, CribbageMove>
ohHellCardGameRules<OhHellGame, OhHellMove>
warCardGameRules<WarGame, WarMove>

Examples

import { CARD_GAME_RULES } from "@johnmorrisdotca/toranpu";
console.log(Object.keys(CARD_GAME_RULES));
[
  '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.