The project is not maintained anymore, and exists primary for historical reasons and references.
Bot was tested with Python 3.7+ and PyPy3, we are not supporting Python 2.
You can find it here: https://github.com/MahjongRepository/mahjong
For research purposes we built a simple bot to play riichi mahjong. It can be run locally.
pip install -r requirements/lint.txt
cd project && python main.py
it will connect to the tenhou.net and will play a game.To make it easier run bot vs bot battles we prepared PyPy3 Docker container.
Run the game locally:
make build_docker
make GAMES=1 run_battle
it will play one game locally. Logs and replays will be stored in bots_battle
folder.Run bots with enabled decision logger (use it only for debug, since it harms performance):
make GAMES=1 ARGS=--logs run_battle
make build_docker
project/settings/
. By default we are looking for these configs: bot_1_settings.py
, bot_2_settings.py
, bot_3_settings.py
, bot_4_settings.py
, 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.make run_on_tenhou
project/settings/settings_local.py
file.
They will override settings from default settings/base.py
file.python main.py -h
to check all available commands.It can be useful to debug bot errors or strange discards: game reproducer