本文へ移動

Jarajaraジャラジャラ

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

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

目次

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

AwaseRun型

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

A game of Awase, and what the challenge it is played as asks of it.

インポート

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

定義

type AwaseRun = {
    readonly size: number;
    readonly seed: number;
    readonly givens: string;
    readonly rules: AwaseRules;
    readonly moves: readonly MahjongMove[];
    readonly cells: MahjongCells;
    readonly shuffles: number;
    readonly hintsUsed: number;
    readonly pairs: number;
    readonly score: number;
    readonly combo: number;
    readonly lastPairAt: number | null;
    readonly bank: number | null;
    readonly bankAt: number | null;
    readonly gold: string | null;
    readonly purge: (typeof PURGE_GROUPS)[number]["key"] | null;
    readonly spark: string | null;
    readonly history: readonly Snapshot[];
    readonly over: "won" | "lost" | null;
    readonly because: "cleared" | "goal" | "gold" | "purged" | "time" | "stuck" | null;
};

メンバー

名前型説明
sizenumber
seednumber
givensstring
rulesAwaseRules
movesreadonly MahjongMove[]

Every move so far, in order: pairs by their slots, and shuffles.

cellsstring
shufflesnumber
hintsUsednumber
pairsnumber

Pairs taken, points scored, and how many pairs in a row were quick enough to build a combo.

scorenumber
combonumber
lastPairAtnumber | null
banknumber | null

The time held and when it was last counted: null before the clock starts, and for a game with no clock.

bankAtnumber | null
goldstring | null

The gold face; the group a purge names; the spark face now.

purge"characters" | "circles" | "bamboo" | "honours" | null
sparkstring | null
historyreadonly Snapshot[]
over"won" | "lost" | null

Won or lost, once it is; and why: cleared, goal, gold, purged, time or stuck.

because"gold" | "cleared" | "goal" | "purged" | "time" | "stuck" | null

例

import { generateAwase, startRun } from "@johnmorrisdotca/jarajara/awase";
import type { AwaseRun } from "@johnmorrisdotca/jarajara/awase";

const deal = generateAwase(4,"easy",2026);
const run = startRun(deal,{},0);
const value: AwaseRun = run;
console.log(value);
{
  size: 4,
  seed: 2026,
  givens: 'xPNxDBBD',
  rules: {
    challenge: null,
    hints: null,
    shuffles: null,
    undo: true,
    timeMs: null,
    reserveMs: null,
    pairBonusMs: 0,
    sparkBonusMs: 0,
    comboBonusMs: 0,
    goalPairs: null,
    goalScore: null,
    hideBlocked: false
  },
  moves: [],
  cells: 'xPNxDBBD',
  shuffles: 0,
  hintsUsed: 0,
  pairs: 0,
  score: 0,
  combo: 0,
  lastPairAt: null,
  bank: null,
  bankAt: null,
  gold: null,
  purge: null,
  spark: null,
  history: [],
  over: null,
  because: null
}

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

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

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