shuffledDeck関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The deck shuffled for one deal of one game: the same seed and deal always the same order, so a game kept as its seed and moves deals itself again exactly, and reloading can never re-deal a hand somebody has seen.
インポート
import { shuffledDeck } from "@johnmorrisdotca/toranpu";
定義
function shuffledDeck(seed: number, deal: number, leaveOut?: readonly CardId[]): CardId[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
seed | number | The numeric seed that reproduces the same shuffle or deal. |
deal | number | The deal number or dealing specification. |
leaveOut (省略可) | readonly string[] | Cards to omit from the generated deck or possibilities. |
戻り値
string[]
The deck shuffled for one deal of one game: the same seed and deal always the same order, so a game kept as its seed and moves deals itself again exactly, and reloading can never re-deal a hand somebody has seen.
例
import { shuffledDeck } from "@johnmorrisdotca/toranpu";
console.log(shuffledDeck(42, 0).slice(0, 7));[
'KC', '9S',
'4C', '5D',
'QS', 'AD',
'4H'
]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。