Review mahjong game log with mjai-compatible mahjong AI, supported engines are Mortal and akochan.
Try it online | Demo result page
It is recommended to just use the online version, which works for Mahjong Soul games out-of-the-box, no download, no install, no extension, and it is free to use.
mjai-reviewer 1.x.x is incompatible with 0.x.x versions, previously known as akochan-reviewer. If you prefer the old version, check out v0 branch.
$ # Review https://tenhou.net/0/?log=2019050417gm-0029-0000-4f2a8622&tw=2
$ # Note that you may need to quote it in the shell to escape the string
$ mjai-reviewer -e mortal -u "https://tenhou.net/0/?log=2019050417gm-0029-0000-4f2a8622&tw=2"
$ # Use akochan as engine
$ mjai-reviewer -e akochan -u "https://tenhou.net/0/?log=2019050417gm-0029-0000-4f2a8622&tw=2"
$ # Alternatively, you can specify the log ID and player ID manually
$ mjai-reviewer -e mortal -t 2019050417gm-0029-0000-4f2a8622 -a 2
$ # Review a local tenhou.net/6 format log file, note that you must specify a player ID
$ mjai-reviewer -e mortal -i log.json -a 3
$ # Review 東2局1本場 and 東3局 only
$ mjai-reviewer -e mortal -k E2.1,E3 -u "https://tenhou.net/0/?log=2019050417gm-0029-0000-4f2a8622&tw=2"
Use the --help
argument for more details.
See FAQ
Set environment variable OMP_NUM_THREADS=8
.
Under cmd
> set OMP_NUM_THREADS=8
Under Powershell
> $env:OMP_NUM_THREADS = 8
Under MSYS2 bash
$ export OMP_NUM_THREADS=8
Try adding the directory of libai.so
to env LD_LIBRARY_PATH
.
Follow the instructions here to install Rust toolchains first, if you haven't yet.
$ cd ..
$ git clone https://github.com/Equim-chan/mjai-reviewer.git
$ cargo build --release
mjai-reviewer
binary will be in target/release
directory.
You also need a trained model file to actually use Mortal.
$ git clone https://github.com/critter-mj/akochan.git
$ cd akochan
You have to edit Makefile
and ai_src/Makfefile
accordingly. Set up correct path for boost and some other options like -march=native
of your choice.
On Windows MSYS2 with MinGW-w64 toolchain
$ pacman -Syu mingw-w64-x86_64-{toolchain,boost}
Edit Makefile
:
LIBS = -lboost_system-mt -lws2_32 -L./ -lai -s
Edit ai_src/Makefile
:
LIBS = -lboost_system-mt -lws2_32
$ cd ai_src
$ make
$ cd ..
$ make
On MacOS
$ brew install llvm libomp boost
$ cd ai_src
$ make -f Makefile_MacOS
$ cd ..
$ make -f Makefile_MacOS
On Arch Linux
$ sudo pacman -Syu base-devel boost
$ make -f Makefile_Linux
$ cd ..
$ make -f Makefile_Linux
Currently the docker image is not maintained and it only embeds akochan engine.
$ git clone https://github.com/Equim-chan/mjai-reviewer.git
$ cd mjai-reviewer
$ git clone https://github.com/critter-mj/akochan.git
$ docker build -t mjai-reviewer:latest .
$ docker run --rm mjai-reviewer:latest -e akochan --no-open -t 2019050417gm-0029-0000-4f2a8622 -a 3 -o - > report.html
$ open report.html # or just open in browser