本文へ移動

Jarajaraジャラジャラ

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

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

目次

リファレンス · 牌・配置・配り方

arrangeIndexes関数

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

The places the tiles take in an order, as the numbers of the tiles in the order they come: [2, 0, 1] has the third tile first. Every sort is stable, so equal tiles stay as they were. suit is the set's own order (characters, circles, bamboo, winds, dragons, flowers, seasons, each by rank); rank puts every one together, then every two, and so on, within each rank by suit, the honours after; kind groups numbers, honours and bonus tiles and puts each in suit order; code is the letters' own order; dealt is the list as it was.

インポート

import { arrangeIndexes } from "@johnmorrisdotca/jarajara";

定義

function arrangeIndexes(codes: readonly string[], order?: TileOrder): number[]

引数

名前型説明
codesreadonly string[]

The tile face codes in current order.

order (省略可)TileOrder

The native tile sorting mode.

戻り値

number[]

The places the tiles take in an order, as the numbers of the tiles in the order they come: [2, 0, 1] has the third tile first. Every sort is stable, so equal tiles stay as they were. suit is the set's own order (characters, circles, bamboo, winds, dragons, flowers, seasons, each by rank); rank puts every one together, then every two, and so on, within each rank by suit, the honours after; kind groups numbers, honours and bonus tiles and puts each in suit order; code is the letters' own order; dealt is the list as it was.

例

import { arrangeIndexes } from "@johnmorrisdotca/jarajara";

console.log(arrangeIndexes(["F","a","b"],"suit"));
[ 1, 2, 0 ]

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

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

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