本文へ移動

Jarajaraジャラジャラ

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

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

目次

リファレンス · 合わせの対戦卓

AwaseTableState型

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

Where a game at the table stands, read from its pairs.

インポート

import type { AwaseTableState } from "@johnmorrisdotca/jarajara/table";

定義

type AwaseTableState = {
    cells: string;
    turn: number;
    scores: number[];
    pairs: number[];
    taken: AwaseTake[];
    shuffles: number;
    shuffledAfter: number | null;
    over: boolean;
    winners: number[];
};

メンバー

名前型説明
cellsstring

The tiles as they lie now.

turnnumber

The seat to move; meaningless once over.

scoresnumber[]

Points, and pairs taken, seat by seat.

pairsnumber[]
takenAwaseTake[]
shufflesnumber

How many times the table ran out of pairs and the tiles were shuffled; and after which take the last was.

shuffledAfternumber | null
overboolean

Over: every tile taken, or the tiles left could not be freed by any shuffle.

winnersnumber[]

The seats with the most points, once it is over: one, or several sharing it.

例

import { generateAwase } from "@johnmorrisdotca/jarajara/awase";
import { readTable, startTable } from "@johnmorrisdotca/jarajara/table";
import type { AwaseTableState } from "@johnmorrisdotca/jarajara/table";

const deal = generateAwase(4,"easy",2026);
const table = startTable(deal,[{name:"Seat 1"},{name:"Seat 2"}]);
const state = readTable(table)!;
const value: AwaseTableState = state;
console.log(value);
{
  cells: 'xPNxDBBD',
  turn: 0,
  scores: [ 0, 0 ],
  pairs: [ 0, 0 ],
  taken: [],
  shuffles: 0,
  shuffledAfter: null,
  over: false,
  winners: []
}

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

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

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