Expand description
A library for calculating the deficiency number (a.k.a. xiàngtīng number, 向聴数).
§Example
// 123m456p789s11222z
let hand: [u8; 34] = [
1, 1, 1, 0, 0, 0, 0, 0, 0, // m
0, 0, 0, 1, 1, 1, 0, 0, 0, // p
0, 0, 0, 0, 0, 0, 1, 1, 1, // s
2, 3, 0, 0, 0, 0, 0, // z
];
let replacement_number = calculate_replacement_number(&hand, &PlayerCount::Four)?;
assert_eq!(replacement_number, 0u8);Enums§
- Bingpai
Error - Errors that occur when an invalid pure hand (純手牌) is provided.
- Player
Count - The number of players.
Traits§
- Tile
Flags Ext - Extension utilities for working with
TileFlags.
Functions§
- calculate_
necessary_ tiles - Calculates the replacement number (= xiàngtīng number + 1) and necessary tiles for a given hand.
- calculate_
replacement_ number - Calculates the replacement number (= xiàngtīng number + 1) for a given hand.
- calculate_
unnecessary_ tiles - Calculates the replacement number (= xiàngtīng number + 1) and unnecessary tiles for a given hand.
Type Aliases§
- Tile
- 牌: Tile.
- Tile
Counts - A type representing the number of tiles for each kind.
- Tile
Flags - A type representing tiles as a bit flag set.