A Japanese Mahjong AI, which can play Mahjong on two online Japanese Mahjong services. It can easily defeat other players in 一般 (Normal level) games and also plays well in 上級 (High level) games.
- Tenhou (http://tenhou.net)
- IMPORTANT: We no longer support Majsoul starting from 0.6.64.w due to abuse of this project.
After 196 matches:
- Visual Studio 2017 or later
- Node.js v8.11.2 or later (required only if you are going to play on Majsoul)
-
Download source code.
git clone https://github.com/zhangjk95/MahjongAI.git
-
Change the working directory to the source code folder.
cd MahjongAI
-
If you are going to play on Majsoul, run
npm install --prefix ./MajsoulHelper ./MajsoulHelper
-
Copy
MahjongAI\App.config.example
toMahjongAI\App.config
and edit it. (Instructions are included in the example.) -
Open the solution with Visual Studio.
-
Switch the Build Configuration to Release. (The program may be slow in Debug mode and exceed the time limit when making dicisions.)
-
Build and Run!
After the game ends, you can find the replay URLs in MahjongAI\bin\Release\replays.txt
.
You can run this program in Docker on either Windows or Linux without ANY requirements other than Docker.
-
Download source code.
git clone https://github.com/zhangjk95/MahjongAI.git
-
Change the working directory to the source code folder.
cd MahjongAI
-
If you are going to play on Majsoul, run
npm install --prefix ./MajsoulHelper ./MajsoulHelper
-
Copy
MahjongAI/App.config.example
toMahjongAI/App.config
and edit it. (Instructions are included in the example.)cp MahjongAI/App.config.example MahjongAI/App.config $EDITOR MahjongAI/App.config
-
Build Docker image.
./build.sh
-
Run.
docker run -it mahjong-ai
Note: The replay URLs are stored in
/usr/src/app/MahjongAI/bin/Release/replays.txt
inside the docker container. If you want to watch replays, You can map a file volume to it in order to save the replays outside the container. Which means, instead of running the command above, you may run the commands below instead:touch ~/replays.txt docker run -v ~/replays.txt:/usr/src/app/MahjongAI/bin/Release/replays.txt -it mahjong-ai
Then after the game ends, you can find the replay URLs in
~/replays.txt
.
This program is under GPL. You can use this program at your OWN risk.
The code calculating "syanten" and "score" are downloaded from http://cmj3.web.fc2.com/.