cardId関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
"QS", "TH", "AC": the two-character id card players write, rank then suit,
with T for the ten. For a game that keys its state by a readable id; a
kept deal is written with cardCode, one character a card.
インポート
import { cardId } from "@johnmorrisdotca/toranpu/deck";
定義
function cardId(card: Card): string
引数
| 名前 | 型 | 説明 |
|---|---|---|
card | Card | The physical card or card id to read, draw or play. |
戻り値
string
"QS", "TH", "AC": the two-character id card players write, rank then suit, with T for the ten. For a game that keys its state by a readable id; a kept deal is written with cardCode, one character a card.
例
import { cardId } from "@johnmorrisdotca/toranpu/deck";
const card = { suit: "spades", rank: 1 } as const;
console.log(cardId(card));AS出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。