The table
Three players, 84 tiles: circles 1–9 (four copies), East/South/West/North, three dragons
(four copies), four flies (jokers), and sixteen bonus tiles (flowers,
seasons, faces and animals). Flowers and bonuses are set aside and replaced immediately.
Each player starts with 13 tiles; the dealer draws a 14th. Play moves East → South → West.
A winning hand is four sets and a pair, seven pairs, or nine gates. Sets are pongs, kongs,
or circle chows. Pongs, kongs and chows can all be claimed; a chow may only be
called by the player immediately after the discarder. A fly may complete a
claimed pong when you hold one copy, or a claimed chow with one real hand tile — but
two flies cannot pong, and kongs always need four original tiles. If a pong used a fly
and you later draw the matching tile, the real tile joins the pong and the fly returns
to your hand; the pong can then be promoted to a kong normally. A tile you discarded
earlier is sacred: you cannot win on a copy of it.
If opponents want the same discard, a win beats a pong or kong, and both beat a chow.
Between two pongs (or two kongs), the player nearest in turn order after the discarder
has first refusal; if they pass, the other player may still claim. A chow is offered
once any higher claim has been declined.
Winning & payment
A hand must be worth at least 5 fan (capped at 10). A win is worth
100 + 20 × fan points. On a self-draw both opponents pay double. On a
discard, the discarder pays double and the other player pays the normal amount. Kongs pay
immediately: 100 from each opponent for a concealed kong, 50 for an exposed or promoted
kong.
The winner becomes dealer for the next hand. If the wall runs out, the hand is a draw and
the dealership passes.
Fan reference
House simplification: faces and animals score one fan each. Limit hands cap at 10 fan.
How the AI improves
The bot uses a small neural network with a shared trunk and three heads: a value estimate,
a discard policy over the 17 playable tile kinds, and a claim policy. A Web Worker plays
three copies of the network against each other, scores every decision by the final points
swing, and updates the network with policy-gradient and value regression. Weights and
evaluation history are saved in local storage.
Early decisions are guided by a shanten/ukeire heuristic. As training continues, the learned
policy takes over. Open AI Lab to watch games, win rate and loss curves.