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 · Oh Hell

OhHellGametype

A GAME OF OH HELL: its table and moves (what is kept, KeptCardGame), and everything the moves make. Three or four seats, each for itself. size is how many deals: 7 (one card, then two, up to seven) or 13 (up to seven and back down to one).

Import it

import type { OhHellGame } from "@johnmorrisdotca/toranpu/oh-hell";

Definition

type OhHellGame = KeptCardGame<OhHellMove> & {
    deal: number;
    phase: OhHellPhase;
    cards: number;
    hands: CardId[][];
    turned: CardId;
    trump: CardSuit;
    bids: (number | null)[];
    trick: OhHellPlay[];
    lastTrick: {
        plays: OhHellPlay[];
        winner: number;
    } | null;
    played: CardId[];
    toPlay: number | null;
    tricks: number[];
    scores: number[];
    dealScores: OhHellDealScore[];
};

Members

NameTypeDescription
sizenumber
playersreadonly string[]
computersreadonly boolean[]
seednumber
movesreadonly OhHellMove[]
dealnumber

Which deal this is, from 0.

phaseOhHellPhase
cardsnumber

The cards each seat holds this deal.

handsstring[][]
turnedstring

The card turned up after the deal: its suit is trumps.

trumpCardSuit
bids(number | null)[]
trickOhHellPlay[]
lastTrick{ plays: OhHellPlay[]; winner: number; } | null
playedstring[]

Every card played in a finished trick this deal.

toPlaynumber | null
tricksnumber[]
scoresnumber[]
dealScoresOhHellDealScore[]

Examples

import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu";
import type { OhHellGame } from "@johnmorrisdotca/toranpu/oh-hell";

const names = Array.from({ length: CARD_GAME_TABLES.ohHell.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`);
const game = newGame("ohHell", { players: names, seed: 42 })!;
const value: OhHellGame = game;
console.log(value.phase);
bidding

What it prints (run when this page was built)

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