riichi-decomp-table

Crates.ioriichi-decomp-table
lib.rsriichi-decomp-table
version0.1.0
sourcesrc
created_at2022-10-08 08:38:45.039187
updated_at2022-10-08 08:38:45.039187
descriptionLookup Table Generation for `riichi-decomp`
homepage
repositoryhttps://github.com/summivox/riichi-rs
max_upload_size
id683405
size25,006
Yin Zhong (summivox)

documentation

README

Lookup Table Generation for riichi-decomp

This crate is NOT intended as a public interface. riichi-decomp should be used instead.

This crate contains algorithms for generating two lookup tables (LUTs). These LUTs speed up decomposition of a waiting hand into "standard" or "regular" form, i.e. not Seven Pairs or Thirteen Orphans. Separating the generation from the main crate makes it possible to call it at compile time through build.rs.

The Tables

For a more detailed explanation, please refer to the source.

"C-Table": Single-suit, 3N+2, Complete

  • Key: octal-packed single-suit tile count histogram; 27 bits in a u32. (this is basically one element of TileSet34::packed from riichi-elements).
  • Value: at most 4 "alternatives", each containing up to 4 groups, with the (optional) pair implied. This is encoded as a nested 4 x 4 x 4-bit array (single-suit hand groups can be encoded in 4 bits) using [nanovec::NanoStackBit] and [nanovec::NanoArrayBit].

"W-Table": Single-suit, 3N+1, Waiting

  • Key: same definition as C-Table
  • Value: radix-packed array of waiting patterns, using [nanovec::NanoStackRadix].
Commit count: 107

cargo fmt