Bot was tested with Python 3.7+ and PyPy3, we are not supporting Python 2.
For research purposes we built a simple bot to play riichi mahjong on tenhou.net server.
Here you can read about bot played games statistic: versions history
How to run it?
pip install -r requirements/lint.txt
cd project && python main.pyit will connect to the tenhou.net and will play a game.
How to run bot battle with pypy
To make it easier run bot vs bot battles we prepared PyPy3 Docker container.
Run the game locally:
- Install Docker
make GAMES=1 run_battleit will play one game locally. Logs and replays will be stored in
Run bots with enabled decision logger (use it only for debug, since it harms performance):
make GAMES=1 ARGS=--logs run_battle
Run multiple bots to play one game
- Install Docker and Install Docker Compose
- Put bot configs to
project/settings/. By default we are looking for these configs:
bot_5_settings.py. Why 5 settings? Because tenhou doesn't start 2+ game in the custom lobby if you are running only 4 bots.
- Put your own settings to the
They will override settings from default
- Also, you can override some default settings with command arguments.
python main.py -hto check all available commands.