computerPair関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The pair a computer in the seat to move takes, or null when there is nothing to take.
インポート
import { computerPair } from "@johnmorrisdotca/jarajara/table";
定義
function computerPair(table: AwaseTable, state?: AwaseTableState | null): [number, number] | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
table | AwaseTable | The shared native table and its recorded pair takes. |
state (省略可) | AwaseTableState | null | A previously replayed native table state, or null to read it again. |
戻り値
[number, number] | null
The pair a computer in the seat to move takes, or null when there is nothing to take.
例
import { generateAwase } from "@johnmorrisdotca/jarajara/awase";
import { computerPair, readTable, startTable } from "@johnmorrisdotca/jarajara/table";
const deal = generateAwase(4,"easy",2026);
const table = startTable(deal,[{name:"Seat 1"},{name:"Seat 2"}]);
const state = readTable(table)!;
console.log(computerPair(table,state));[ 4, 7 ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。