本文へ移動

Jarajaraジャラジャラ

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

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

目次

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

playSolve関数

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

PLAY THE MOVES ON THE DEAL, refusing the first that the rules do not allow: a pair that is not two free tiles that match, or a shuffle while a pair could still be taken (Shuffle is for when you are stuck), or one that cannot help. Null for a deal or a move that does not read.

インポート

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

定義

function playSolve(size: number, givens: string, moves: readonly MahjongMove[], rule?: MahjongBonusRule): Replayed | null

引数

名前型説明
sizenumber

The native layout size identifier, measured in tiles across.

givensstring

The original face-code deal in native slot order.

movesreadonly MahjongMove[]

The native pair and shuffle moves in chronological order.

rule (省略可)MahjongBonusRule

Grouped or identical bonus matching.

戻り値

Replayed | null

PLAY THE MOVES ON THE DEAL, refusing the first that the rules do not allow: a pair that is not two free tiles that match, or a shuffle while a pair could still be taken (Shuffle is for when you are stuck), or one that cannot help. null for a deal or a move that does not read.

例

import { generateAwase } from "@johnmorrisdotca/jarajara/awase";
import { freePairs, geometryOf, layoutFor, playSolve } 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(playSolve(4,cells,[{pair}],"group")?.cells);
xPNx.BB.

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

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

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