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. Chows cannot be claimed from a discard; pongs and kongs
can, and a fly may complete a claimed pong when you hold one copy — but two flies
cannot pong, and kongs always need four original tiles. A tile you discarded earlier
is sacred: you cannot win on a copy of it.
If both opponents want the same discard, a win beats a pong or kong. 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.
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.