Jarajara documentation
Jarajara ジャラジャラ — Mahjong tiles and mahjong solitaire
Draw mahjong tiles, arrange racks and stacked boards, and play seeded Awase alone or at a shared table.
Install
npm install @johnmorrisdotca/jarajara
Start here
Entry points
| Import it | What it is | Size |
|---|---|---|
@johnmorrisdotca/Awase solitaire · 33 exports | Awase (合わせ, "matching"): the matching solitaire. | 7.7 kB |
@johnmorrisdotca/Shared Awase table · 19 exports | 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. | 4.7 kB |
@johnmorrisdotca/SVG faces and looks · 52 exports | The tiles, drawn: each of the 42 faces as SVG text, a tile on its own, its back, and a whole layout of stacked tiles, on a cloth if you like. | 41.9 kB |
@johnmorrisdotca/Tile and table elements · 25 exports | Jarajara's custom elements, as classes, with nothing defined: import this to extend them or to define them under other names. | 97.7 kB |
@johnmorrisdotca/Register the elements · 0 exports | Defines Jarajara's custom elements on the page: <jarajara-tile>, <jarajara-rack>, <jarajara-layout>, <jarajara-table>, <jarajara-group>, <jarajara-set> and <jarajara-viewer>. | 97.4 kB |
@johnmorrisdotca/Riichi design · 1 exports | The regular riichi design: FluffyStuff's riichi mahjong tiles (public domain, CC0; see CREDITS.md), the 34 faces of a riichi set with the tile's own plate and back and the red fives. | 16.6 kB |
@johnmorrisdotca/Black riichi design · 1 exports | The black riichi design: FluffyStuff's riichi mahjong tiles (public domain, CC0; see CREDITS.md), the 34 faces of a riichi set with the tile's own plate and back and the red fives. | 16.5 kB |
@johnmorrisdotca/Sound controls · 10 exports | The sounds of a mahjong table: a tile picked up, set down or turned over, a pair knocked together, the tiles shuffled, a clatter for a win. | 26.7 kB |
@johnmorrisdotca/Recorded sounds · 2 exports | 24.4 kB | |
@johnmorrisdotca/Tiles, layouts and deals · 93 exports | Jarajara: mahjong tiles for JavaScript and TypeScript. | 7.9 kB |
Guides
How-to
- Read names, notation and racksTell tile codes from notation, arrange a rack without changing its tiles, and use the rack element.
- Draw SVG and select designsDraw tiles and layouts as SVG strings or elements, load only the designs you need, and keep SVG identifiers apart.
- Play solitaire and challengesTake free matching pairs, pass the time in yourself for challenges, and keep hints and refusals.
- Play at a shared tablePlay two to four players at one table, score pairs, and restore a table from its record.
- Embed racks, elements and soundsRegister the tile elements in a browser, embed a rack, and add optional sounds.
Explanation
- Stacked geometry and SVG viewsPlace tiles on a half-tile grid, draw the same layout in different views, and keep rules apart from display.
- Seeded deals and replayed recordsGenerate a solvable layout from a seed, save it as a layout and moves, and replay it.