/flush-shanten

A python and rust implementation of calculating "shanten number" in Japanese mahjong, only for flush hand

Primary LanguageRustMIT LicenseMIT

Flush Shanten

A python and rust implementation of calculating "shanten number" in Japanese mahjong, only for flush hand

How To Use

git clone --recursive https://github.com/habara-k/flush-shanten.git
cd flush-shanten
mkdir build
cd build
cmake ..
make
python3 ../shanten.py
rustc -C opt-level=3 -C debug_assertions=no ../shanten.rs
./shanten
./verify

Benchmark

Using 3.2GHz CPU and 8GB RAM,

  • shanten.py: 42±1 sec
  • shanten.rs: 2.15±0.08 sec

Description

清一色のシャンテン数を01BFSで計算する

Licence

MIT

Author

habara-k