本文へ移動

Jarajaraジャラジャラ

麻雀牌を描き、手牌や積み重ねた盤を配置し、シード付きの「合わせ」をひとりでも対戦卓でも遊べます。

「ジャラジャラ」は麻雀牌が触れ合う音を表す言葉です。 名前について(英語)

目次

リファレンス · 牌・配置・配り方

matchesOf関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

EVERY TILE THAT MATCHES A SLOT'S, under the bonus rule in play, told apart by whether it could be taken with it now. A tile's own slot is never in either list, and an empty slot has no matches. Pure: it reads the tiles as they lie.

インポート

import { matchesOf } from "@johnmorrisdotca/jarajara";

定義

function matchesOf(geometry: MahjongGeometry, cells: MahjongCells, rule: MahjongBonusRule, slot: number): MatchesOf

引数

名前型説明
geometryMahjongGeometry

The stacked layout’s covering and side-blocking relationships.

cellsstring

The face-code string in native slot order; dot marks a removed tile.

ruleMahjongBonusRule

Grouped or identical bonus matching.

slotnumber

The zero-based slot index or slot coordinates specified by this signature.

戻り値

MatchesOf

EVERY TILE THAT MATCHES A SLOT'S, under the bonus rule in play, told apart by whether it could be taken with it now. A tile's own slot is never in either list, and an empty slot has no matches. Pure: it reads the tiles as they lie.

例

import { generateAwase } from "@johnmorrisdotca/jarajara/awase";
import { freePairs, geometryOf, layoutFor, matchesOf } from "@johnmorrisdotca/jarajara";

const deal = generateAwase(4,"easy",2026);
const layout = layoutFor(4)!;
const geometry = geometryOf(layout);
const cells = deal.givens;
const pair = freePairs(geometry,cells,"group")[0];
console.log(matchesOf(geometry,cells,"group",pair[0]));
{ free: [ 7 ], blocked: [] }

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/jarajara 1.7.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。