chooseCrib関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The two cards to lay away: the four kept worth most on average with every starter, the crib counted for or against.
インポート
import { chooseCrib } from "@johnmorrisdotca/toranpu/cribbage";
定義
function chooseCrib(hand: readonly CardId[], ownCrib: boolean): [CardId, CardId]
引数
| 名前 | 型 | 説明 |
|---|---|---|
hand | readonly string[] | The player’s held cards, or the hand number for a deal. |
ownCrib | boolean | Whether the crib belongs to this player. |
戻り値
[string, string]
The two cards to lay away: the four kept worth most on average with every starter, the crib counted for or against.
例
import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu";
import { chooseCrib } from "@johnmorrisdotca/toranpu/cribbage";
const names = Array.from({ length: CARD_GAME_TABLES.cribbage.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`);
let game = newGame("cribbage", { players: names, seed: 42 })!;
console.log(chooseCrib(game.hands[0]!, true));[ '2H', 'QS' ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。