Tile Notation
RabiRiichi uses a compact ASCII notation for tiles and hands. It's what
Tile/Tiles parse from strings, what the test suite is written in, and what
these docs use to render real tile images.
Single tiles
A tile is a number 1–9 followed by a suit letter:
| Suit letter | Meaning | Example | Renders |
|---|---|---|---|
m | man (万 / characters) | 1m | |
p | pin (筒 / circles) | 5p | |
s | sou (索 / bamboo) | 9s | |
z | honor (字) | 1z |
Honor tiles (z) are numbered 1–7: 1z–4z are the winds
East / South / West / North, and 5z–7z are the dragons White / Green / Red.
Red fives (akadora)
A red five is written with a leading r, or with the digit 0. So r5p, 0p
both mean "red 5 pin":
Multiple tiles
Consecutive digits share the next suit letter, so a whole suit collapses nicely:
123m → 1m 2m 3m
11222333s → two 1s, three 2s, three 3s
You can freely mix suits by repeating the pattern (digits + suit), and add a
red five anywhere with r or 0:
Melds and the winning tile (docs helper)
When showing an example hand, the docs' <Tiles> helper accepts extra
segments separated by +. The convention (mirroring the test builders) is:
<hand> + <meld> + <meld> ... + <winning tile>
-
Called (open) meld — prefix the claimed tile with
-. The-marks the rotated tile taken from another player's discard.A meld 456m called from another player (the 4m is rotated); winning on 4s -
Concealed kan (ankan) — bracket the visible pair with
xfor the two face-down back tiles:x11xs.Four concealed kans plus a pair wait -
Winning tile — the final segment is the tile the hand completes on.
Winning on 4s
The +-separated meld/winning-tile layout is how the image service and the
test builders present a hand. The engine's own Tile(string) / Tiles(string)
parsers handle a single group of tiles (the digit/suit/r/0 rules above); the
richer + layout is assembled by helpers like StdTestBuilder
(see Yaku unit tests).
Rendering tiles in the docs
These docs ship a global <Tiles> MDX component (no import needed) backed by a
tile-image service. Pass it a notation, and optionally a caption or
inline:
<Tiles notation="123m456p789s11z" />
<Tiles notation="11222333s22456m+4s" caption="Iipeikou, winning on 4s" />
An inline tile like <Tiles notation="0p" inline /> sits in a sentence.
renders as:
An inline tile like sits in a sentence.
Because the images come from notation, you never have to add or manage tile art in this repo — just write the notation and the correct hand appears.
Grammar reference (engine parser)
From Core/Tile.cs and Core/Extensions.cs:
- Suit letters map case-insensitively:
m→M,p→P,s→S,z→Z; anything else is invalid and throws. - A single tile is exactly
<digit><suit>, optionally prefixed withr. Digit0is shorthand for a red 5 (Num = 5,Akadora = true). - A tile list accumulates digits until a suit letter assigns the suit to all
pending digits; an
rflags the following digit as a red five. - Internally a
Tileis a single packed byte: bits 0–3 the number, bits 4–6 the suit, bit 7 the akadora flag.IsSamecompares two tiles ignoring the red-five bit, which is the usual "same tile kind" test.
See Tiles & melds for the full Tile / Tiles API.