Crates.io | riichi-tools-rs |
lib.rs | riichi-tools-rs |
version | 0.0.70 |
source | src |
created_at | 2021-03-16 21:30:13.999322 |
updated_at | 2021-05-04 07:30:56.019363 |
description | Riichi Mahjong tools library, mostly for WASM |
homepage | https://riichi.harphield.com/tools/ |
repository | https://github.com/harphield/riichi-tools-rs |
max_upload_size | |
id | 369937 |
size | 4,797,168 |
A tool library for riichi mahjong written in Rust, made mostly to be used as a WASM component.
Lots of inspiration from other mahjong tools, like https://euophrys.itch.io/mahjong-efficiency-trainer, http://tenhou.net/2/, http://kobalab.net/majiang/dapai.html etc.
Showcase / frontend of this library can be found at https://riichi.harphield.com/tools/
There are two implementations of shanten and uke-ire calculations available. The default one is slower, but doesn't use any lookup tables, so it creates a smaller binary: ideal for WASM.
The other one is a port from Spines.Mahjong and is a lot faster, but the binary is larger.
You can enable the faster mode with enabling the feature in your cargo.toml:
riichi-tools-rs = { version = "0.0.70", features = ["fast_shanten"] }
Hand::from_text()
method accepts a string representation in the following format:
0
- for example (p0m2). If it was the red 5 that was called, r is addedSome examples:
123m44456888s678p
456s11133z(456m1)(456p0)
4z(p1z1)(k2z)(s3z3)(p6z2)