Japanese riichi mahjong hand calculator library.
Compute hand cost (han, fu, yaku, and scores), validate winning hands, and calculate shanten (minimum tiles to tenpai).
The code was validated on tenhou.net phoenix replays: 26,148,050 four-player and 8,406,421 three-player winning hands.
So, we can say that our hand calculator works the same way that tenhou.net hand calculation.
- API reference
- Wiki — Supported rules and usage examples
pip install mahjongFor guidance on setting up a development environment and contributing to mahjong, see Contributing to mahjong.
This library is licensed under the MIT license.