CribbageMove型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Two cards laid away to the crib, or one card played in the pegging.
インポート
import type { CribbageMove } from "@johnmorrisdotca/toranpu/cribbage";
定義
type CribbageMove = {
crib: [
CardId,
CardId
];
} | {
play: CardId;
};
例
import { CARD_GAME_TABLES, newGame, rulesFor } from "@johnmorrisdotca/toranpu";
import type { CribbageMove } from "@johnmorrisdotca/toranpu/cribbage";
const names = Array.from({ length: CARD_GAME_TABLES.cribbage.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`);
const game = newGame("cribbage", { players: names, seed: 42 })!;
const value: CribbageMove = rulesFor("cribbage").moves(game)[0]!;
console.log(value);{ crib: [ 'AD', '3S' ] }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。