trickWinner関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Who takes a finished trick: the highest card of the suit led.
インポート
import { trickWinner } from "@johnmorrisdotca/toranpu/hearts";
定義
function trickWinner(trick: readonly HeartsPlay[]): number
引数
| 名前 | 型 | 説明 |
|---|---|---|
trick | readonly HeartsPlay[] | The cards and seats in the current trick. |
戻り値
number
Who takes a finished trick: the highest card of the suit led.
例
import { trickWinner } from "@johnmorrisdotca/toranpu/hearts";
console.log(trickWinner([{ seat: 0, card: "2C" }, { seat: 1, card: "AC" }, { seat: 2, card: "KH" }, { seat: 3, card: "QC" }]));1出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。