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
| Name | Type | Description |
|---|---|---|
hand | readonly string[] | The player’s held cards, or the hand number for a deal. |
trump | CardSuit | 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"));JCWhat it prints (run when this page was built)