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

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

3.2 kB minified and gzipped, with everything it imports (measured with esbuild)

Oh Hell: its rules, its computer player and its saved-game format.

Exports

NameKindWhat it is
chooseOhHellBidfunctionThe bid nearest what the hand is worth, among those allowed.
dealerOffunctionThe seat that deals this deal: the first seat, then round to the left.
dealPointsfunctionWhat a seat scores for a deal: ten and its bid for exactly what it bid, nothing otherwise.
dealSizesfunctionThe cards dealt to each seat in each deal of a game of this length: up to seven, and back down in the long game.
decodeOhHellfunctionText read back into the game of Oh Hell it records, by playing every move again through the rules; null for anything they cannot play out.
encodeOhHellfunctionA game of Oh Hell as text: its table, its seed and its moves, never a hand.
OH_HELL_MOST_CARDSconstantThe most cards dealt to a hand of Oh Hell: seven.
OH_HELL_RULESconstantOh Hell as one CardGameRules: everything a table asks of the game.
ohHellBidsfunctionThe bids open to the seat to bid: nought to the cards in hand, less the one a dealer may not make.
ohHellComputerfunctionThe move a computer in the seat to play makes: always one the rules allow.
OhHellDealScoretypeWhat one finished deal did: each seat's bid, the tricks it took, and what it scored.
OhHellGametypeA GAME OF OH HELL: its table and moves (what is kept, KeptCardGame), and everything the moves make.
ohHellHeightfunctionA card's height in a trick: ace high.
OhHellMovetypeA bid of tricks, nought up to the cards in hand, or one card played to the trick.
ohHellMovesfunctionEvery move the seat to play may make now; none once the game is over.
OhHellPhasetypeBidding the exact number of tricks each seat will take, playing the deal out, or the game over.
OhHellPlaytypeOne card laid, and whose it was.
ohHellPlayablefunctionThe cards the seat to play may lay: the suit led if it holds any.
ohHellTrickWinnerfunctionWho takes a trick: the highest trump, or else the highest card of the suit led.
ohHellViewfunctionThe part of the game the seat to play can see, which is all its computer is given.
OhHellViewtypeA COMPUTER AT THE OH HELL TABLE.
ohHellWinnersfunctionThe highest score after the last deal: every seat that has it.
ohHellWorthfunctionThe tricks a hand should take with these trumps, roughly.
playOhHellfunctionThe game after that move, with the move added to its record, or null for a move the rules refuse.
sortOhHellfunctionA hand as a player holds it: by suit, trumps last, high cards to the right.
startOhHellfunctionA new game of Oh Hell for these players (one name a seat) at this size, dealt from the seed dealt, or null for a table Oh Hell is not offered for.

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