本文へ移動

Jarajaraジャラジャラ

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

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

目次

リファレンス · 合わせのひとり遊び

AwaseRules型

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

What a game is played by, worked out from its options and its challenge.

インポート

import type { AwaseRules } from "@johnmorrisdotca/jarajara/awase";

定義

type AwaseRules = {
    challenge: AwaseChallenge | null;
    hints: number | null;
    shuffles: number | null;
    undo: boolean;
    timeMs: number | null;
    reserveMs: number | null;
    pairBonusMs: number;
    sparkBonusMs: number;
    comboBonusMs: number;
    goalPairs: number | null;
    goalScore: number | null;
    hideBlocked: boolean;
};

メンバー

名前型説明
challenge"gold" | "spark" | "rush" | "fortune" | "sand" | "purge" | "blackout" | null
hintsnumber | null
shufflesnumber | null
undoboolean
timeMsnumber | null

The time a game starts with, in milliseconds; null for no clock.

reserveMsnumber | null

The most time a game may be holding: pairs add to a clock only up to this. Null for no limit.

pairBonusMsnumber

Time added by every pair, by a pair of the spark face, and for each step of a combo.

sparkBonusMsnumber
comboBonusMsnumber
goalPairsnumber | null

Pairs to make, or points to reach, to win without clearing the layout; null where the layout must be cleared (or the gold pair taken, or the group purged).

goalScorenumber | null
hideBlockedboolean

Only the free tiles show their faces: a page draws the blocked ones blank (hideBlocked).

例

import { awaseRules, generateAwase } from "@johnmorrisdotca/jarajara/awase";
import type { AwaseRules } from "@johnmorrisdotca/jarajara/awase";

const deal = generateAwase(4,"easy",2026);
const cells = deal.givens;
const value: AwaseRules = awaseRules(cells.length,{challenge:"rush"});
console.log(value);
{
  challenge: 'rush',
  hints: null,
  shuffles: null,
  undo: true,
  timeMs: 180000,
  reserveMs: null,
  pairBonusMs: 0,
  sparkBonusMs: 0,
  comboBonusMs: 0,
  goalPairs: 2,
  goalScore: null,
  hideBlocked: false
}

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

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

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