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[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
codes | readonly 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 ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。