• Stars
    star
    887
  • Rank 51,456 (Top 2 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸ”πŸ€„οΈ Review mahjong game log with mjai-compatible mahjong AI.

mjai-reviewer

GitHub Workflow Status dependency status GitHub top language Lines of code GitHub code size in bytes License

Review your mahjong gameplay with the help of mjai-compatible mahjong AI engines, including Mortal and akochan.

Try it online | Demo result page

It is recommended to just use the web app, 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, which were previously known as akochan-reviewer. If you prefer the old version, check out v0 branch.

Guide on reviewing mahjong soul logs locally

Usage

$ # 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.

FAQ

See FAQ.

Troubleshooting

(akochan) Assertion failed errors on Windows

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

(akochan) libai.so not found on Linux

Try adding the directory of libai.so to env LD_LIBRARY_PATH.

Build

mjai-reviewer

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.

Engines

Mortal

See Mortal's documentation.

You also need a trained model file to actually use Mortal.

Akochan

$ 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

Docker

Currently the docker image is not maintained and it only embeds akochan engine.

Build

$ 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 .

Usage

$ 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

License

Apache-2.0

Contributors

Contributors

More Repositories

1

Mortal

πŸš€πŸ€„οΈ A fast and strong AI for riichi mahjong, powered by Rust and deep reinforcement learning.
Rust
736
star
2

h2s

πŸ”Œ A simple tool that wraps HTTPS proxies into a SOCKS5 proxy.
Go
122
star
3

cryptonight

➿ Pure Go/ASM implementation of CryptoNight hash function with its variants, without any CGO binding.
Go
77
star
4

vanity-monero

πŸ’³ Generate vanity address for CryptoNote currency (Monero etc.).
Go
64
star
5

base256

πŸŒ€ binary-to-emoji encoding.
Go
30
star
6

tensoul

Convert MahjongSoul log into tenhou.net/6 format
JavaScript
24
star
7

koa-virtual-host

⚑ A name-based virtual host middleware for Koa2.
JavaScript
16
star
8

base91

πŸ”‘ basE91 codec in pure JavaScript implementation.
JavaScript
13
star
9

base91-go

πŸ”‘ basE91 codec in pure Golang implementation.
Go
9
star
10

leb128

Go implementation of Little Endian Base 128 codec.
Go
8
star
11

sha3sum

A sha3sum CLI utility based on golang.org/x/crypto/sha3
Go
6
star
12

broken-pantsu

πŸ’˜ Love, rather than sorry.
Go
6
star
13

csu-ems-api

πŸ” A kit of third-party APIs for the EMS of CSU, based on Node.js.
JavaScript
5
star
14

soda-old

1 of 3 - Get Away from Eve.
Go
2
star
15

tenhou-convlog

Convert tenhou log to format ι›»θ„³ιΊ»ε°† can understand
JavaScript
2
star
16

My-OJ-Solutions

βœ… My solutions in LeetCode OJ, Codewars, Vijos, AOJ, CSUOJ, etc..
C#
1
star
17

util

A kit of helpful utilities for Golang.
Go
1
star
18

eae

2 of 3: Alice Across over Time
Go
1
star
19

thompson-hack-go

PoC of a Thompson hack upon Go.
Go
1
star
20

Equim-chan

1
star
21

str-cat

Rust
1
star
22

libb256

C implementation of base256 (a binary-to-emoji encoding).
C
1
star
23

equim-chan.github.io

HTML
1
star