cardCodefunction
One character for a card (CARD_ALPHABET).
Import it
import { cardCode } from "@johnmorrisdotca/toranpu/deck";
Definition
function cardCode(card: Card): CardCode
Parameters
| Name | Type | Description |
|---|---|---|
card | Card | The physical card or card id to read, draw or play. |
Returns
string
One character for a card (CARD_ALPHABET).
Examples
import { cardCode } from "@johnmorrisdotca/toranpu/deck";
const card = { suit: "spades", rank: 1 } as const;
console.log(cardCode(card));AWhat it prints (run when this page was built)