Skip to the content

Jarajaraジャラジャラ

Draw mahjong tiles, arrange racks and stacked boards, and play seeded Awase alone or at a shared table.

Jarajara is the Japanese sound of mahjong tiles rattling together. About the name

Contents

Explanation

Stacked geometry and SVG views

Place tiles on a half-tile grid, draw the same layout in different views, and keep rules apart from display.

Half-tile units preserve overlap

MahjongSlot is the top-left corner in half-tile units across/down plus layer. A tile covers two units each way, so it can sit halfway across two below. geometryOf computes covering and left/right blocking relationships once; isFree/freePairs use that geometry and current occupancy.

Drawing is another view of the same slots

layoutExtent describes native width, height and layers. tileAt, layoutBox and layoutFrame place solid tiles, layer offsets and shadows, including mirrored views. View rotation does not make a covered tile free. Slot sorting changes display order, not the recorded slot indices of a deal.

Keep rules and presentation separate

The root checks tiles/layouts/moves, faces supplies SVG strings, and elements supply DOM lifecycle. A host drawing its own board should feed the native geometry and code order into rules. Existing LOOK.md explains visual choices; the architecture tree preserves file-by-file detail.

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/jarajara 1.7.0.