Crates.io | riichi_hand |
lib.rs | riichi_hand |
version | 0.6.3 |
source | src |
created_at | 2022-01-21 16:33:00.055167 |
updated_at | 2024-05-03 08:52:59.210342 |
description | A collection of utilities for working with Riichi Mahjong player hands |
homepage | https://github.com/m4tx/riichi-hand-rs |
repository | https://github.com/m4tx/riichi-hand-rs |
max_upload_size | |
id | 518620 |
size | 4,086,286 |
A collection of utilities for working with Riichi Mahjong player hands to use with Rust programming language.
This currently includes:
123m456p_7*77z
BigInt
support)Add the following to your Cargo.toml
:
[dependencies]
riichi_hand = "0.6.3"
On the feature flags overview, please refer to the crate documentation.
use riichi_hand::parser::HandParser;
use riichi_hand::raster_renderer::fluffy_stuff_tile_sets::YELLOW_FLUFFY_STUFF_TILE_SET;
use riichi_hand::raster_renderer::{RasterRenderer, RenderOptions};
fn main() {
let hand = HandParser::parse("123m123p123sEESS").unwrap();
let image = RasterRenderer::render(&hand, &*YELLOW_FLUFFY_STUFF_TILE_SET, RenderOptions::default());
image.save("/tmp/hand.png").unwrap();
}
This results in the following image being generated:
The project is licensed under the MIT license.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the project by you shall be licensed as MIT, without any additional terms or conditions.
This project uses modified riichi-mahjong-tiles by FluffyStuff, licensed under CC BY 4.0.
This project uses mahjong tiles by Martin Persson which are free for personal and commercial use under the condition that a link to the author's page is provided.