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 · Euchre

throwAwayfunction

After picking the turned card up: the lowest card outside trumps, from the shortest suit, never an ace.

Import it

import { throwAway } from "@johnmorrisdotca/toranpu/euchre";

Definition

function throwAway(hand: readonly CardId[], trump: CardSuit): CardId

Parameters

NameTypeDescription
handreadonly string[]

The player’s held cards, or the hand number for a deal.

trumpCardSuit

The current trump suit.

Returns

string

After picking the turned card up: the lowest card outside trumps, from the shortest suit, never an ace.

Examples

import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu";
import { throwAway } from "@johnmorrisdotca/toranpu/euchre";

const names = Array.from({ length: CARD_GAME_TABLES.euchre.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`);
let game = newGame("euchre", { players: names, seed: 42 })!;
console.log(throwAway(game.hands[0]!, "H"));
JC

What it prints (run when this page was built)

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