hintPair関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What a hint is: the free pair that leaves the stacks lowest after it, so a hint never digs a tile deeper than it must.
インポート
import { hintPair } from "@johnmorrisdotca/jarajara/element";
定義
function hintPair(layout: MahjongLayout, cells: string, rule: MahjongBonusRule): [number, number] | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
layout | MahjongLayout | The native stacked tile positions. |
cells | string | The face-code string in native slot order; dot marks a removed tile. |
rule | MahjongBonusRule | Grouped or identical bonus matching. |
戻り値
[number, number] | null
The preferred legal free pair, or null when no matching free pair exists.
例
import { generateAwase } from "@johnmorrisdotca/jarajara/awase";
import { layoutFor } from "@johnmorrisdotca/jarajara";
import { hintPair } from "@johnmorrisdotca/jarajara/element";
const deal = generateAwase(4,"easy",2026);
const layout = layoutFor(4)!;
const cells = deal.givens;
console.log(hintPair(layout,cells,"group"));[ 4, 7 ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。