リファレンス
合わせの対戦卓
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. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。