dealRound関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Deals the cards one at a time round the table, from the first seat, as a
dealer does: each to a seat, or every card when each is absent (so some
seats hold one more than others). What is not dealt is the stock, in order,
its top card first.
インポート
import { dealRound } from "@johnmorrisdotca/toranpu";
定義
function dealRound(deck: readonly CardId[], seats: number, each?: number): { hands: CardId[][]; stock: CardId[]; }
引数
| 名前 | 型 | 説明 |
|---|---|---|
deck | readonly string[] | The deck in its current order; the input is left unchanged. |
seats | number | The seat count or seat state supplied by this API. |
each (省略可) | number | undefined | The number of cards dealt to each hand. |
戻り値
{ hands: CardId[][]; stock: CardId[]; }
Deals the cards one at a time round the table, from the first seat, as a dealer does: each to a seat, or every card when each is absent (so some seats hold one more than others). What is not dealt is the stock, in order, its top card first.
例
import { FULL_DECK, dealRound } from "@johnmorrisdotca/toranpu";
console.log(dealRound(FULL_DECK, 4, 5).hands.map((hand) => hand.length));[ 5, 5, 5, 5 ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。