本文へ移動

Jarajaraジャラジャラ

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

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

目次

リファレンス

合わせの対戦卓

import { … } from "@johnmorrisdotca/jarajara/table";

最小化と gzip 圧縮をしたサイズは 4.7 kB(読み込むものをすべて含み、esbuild で計測)

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

Awase at a table, for two to four: one layout, turns taken, each pair scoring (the plain suits one, ones and nines two, a wind three, a dragon four, a flower or season two and another turn), most points wins. With a computer player for any seat.

エクスポート

名前種類概要
AWASE_TABLE定数THE RULES AT THE TABLE.
AwaseSeat型Who sits in a seat: a name typed on the device, or a computer.
AwaseTable型A GAME AT THE TABLE, as it is kept: the deal, who sits where, and every pair taken, in order.
AwaseTableState型Where a game at the table stands, read from its pairs.
AwaseTake型One pair taken, as the table remembers it.
computerPair関数The pair a computer in the seat to move takes, or null when there is nothing to take.
decodeTable関数A kept table read back, its shape checked and every pair played again; null for anything that is not one.
encodeTable関数As kept in the browser: the table as JSON, its takes as slot pairs.
isComputerSeat関数Whether a computer plays this seat.
playAtTable関数The player to move takes this pair: the table and where it now stands, or null where the rules do not allow it.
readTable関数WHERE THE GAME STANDS, played again from its pairs: null for a deal that is not one, or a pair the rules would not have allowed.
SEAT_WINDS定数The four seats' winds, east first, as a mahjong table seats its players.
seatName関数What a seat is called: its name, "Computer 2", or its wind.
startTable関数A new game at the table: the deal made from the seed, these seats, and nothing taken.
tablePairs関数The pairs the player to move may take: none once the game is over.
tablePlayersAsked関数A players count from an address, or 1 (the solitaire) for anything that is not two to four.
takeAtTable関数The table after the player to move takes this pair, or null where the rules do not allow it.
tidySeatName関数A name as kept: trimmed, one line, and no longer than a line holds.
undoAtTable関数The table with its last pair given back: the undo a table agrees to.

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

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