You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Release Notes
Fixed
Rinshan kaihou with haitei or ippatsu: A win on a kan replacement tile no longer also scores haitei or ippatsu. The replacement tile is never the haitei tile, and the winner's own kan breaks ippatsu.
Install agari 0.27.0
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/agari-industries/agari/releases/download/v0.27.0/agari-installer.sh | sh
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Release Notes
Added
Sanma: Rules::sanma() scores three-player mahjong. 2m-8m are left out of the wall, so a 1m dora indicator points to 9m, and there is no chi and no North seat or round. A tsumo is paid by the two other players at their usual share, so it pays less than at four players (tsumo loss). Rules::players() gives the table size. CLI: --sanma.
Nukidora: GameContext::with_nukidora(n) sets the Norths pulled in sanma. Each is one han, reported apart as DoraCount::nuki and YakuResult::nuki_dora, and counts again when a dora or ura indicator points at North. Pulled Norths are never hand tiles and count toward a counted yakuman. CLI: --nuki <N>.
Rules-aware validation: validate_hand_with_context checks a hand and its context against the rules before scoring, and validate_tiles_and_calls checks the tiles and calls of a hand of any size. Under sanma rules both refuse 2m-8m (including a red 5m) and chi, and validate_hand_with_context also refuses a North seat or round and a fifth North; under four-player rules it refuses nukidora. Rules::in_wall, Rules::allows_chi, Rules::allows_nukidora and Rules::has_wind answer the same questions directly, and Rules::dora_for gives the dora an indicator points to.
Sanma ukeire: calculate_ukeire_with_rules counts only tiles in the wall. The CLI's --shanten and --ukeire take --sanma.
WASM: ScoreRequest takes nukidora, and rules selects sanma with {"variant": "Sanma"}; the response's dora gains nuki. calculate_ukeire_js takes an optional sanma flag.
Web UI: A 4 Players / 3 Players toggle leads the options. Three-player mode drops 2m-8m, chi and the North seat and round from the choices and adds a nukidora counter, and shareable URLs carry the mode and the nukidora count.
A second digest test pins sanma scoring: 100,000 generated hands, hashed to one value. The standard digest is unchanged.
Changed
New public fields: Rules gains variant, GameContext gains nukidora, DoraCount gains nuki and YakuResult gains nuki_dora, each after the existing fields and defaulted when deserializing, so previously serialized values read as four-player scoring. Struct literals of GameContext, DoraCount and YakuResult need updating; GameContext::new and previously serialized values are unaffected.
WASM validation: score_hand now checks the tile count and copies before scoring, so a wrong-sized hand gets a clear error instead of "No valid hand structure found", and a hand holding a fifth copy of a tile is refused where it used to score.
Install agari 0.26.0
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/agari-industries/agari/releases/download/v0.26.0/agari-installer.sh | sh
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Release Notes
Added
Optional rules: Rules holds switches for local yaku and is carried on GameContext (with_rules). Rules::default() scores exactly as before, and a golden digest test over 100,000 generated hands pins standard scoring. The WASM ScoreRequest accepts rules, is_open_riichi and is_renhou.
Open riichi: With Rules::open_riichi, a closed hand marked with GameContext::open_riichi() scores OpenRiichi (2 han) in place of riichi, or OpenDoubleRiichi (3 han) in place of double riichi. CLI: --open-riichi.
Renhou: Rules::renhou sets what renhou is worth for a closed non-dealer ron marked with GameContext::renhou(): Renhou::Mangan (without other yaku or dora, unless the hand scores more without renhou, as in EMA, WRC and JPML rules), Renhou::Yakuman, or Renhou::Han(n) (at least 1), which combines with other yaku and dora. CLI: --renhou <mangan|yakuman|N>.
Yaku::is_local(): Marks the local yaku so callers can list them separately.
Changed
New Yaku variants and GameContext fields: Yaku gains the local yaku OpenRiichi, OpenDoubleRiichi and Renhou(Renhou) after its existing variants, which keep their indices in positional formats, and GameContext gains is_open_riichi, is_renhou and rules. Exhaustive matches on Yaku and struct literals of GameContext need updating; GameContext::new and previously serialized contexts are unaffected.
Install agari 0.25.0
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/agari-industries/agari/releases/download/v0.25.0/agari-installer.sh | sh
Ryanpeikou with four identical sequences: A closed hand of four identical sequences (for example 777788889999m11p, four 789m sequences plus an 11p pair) now scores ryanpeikou (3 han) instead of iipeikou (1 han). Four copies of the same sequence form two identical-sequence pairs, so the hand is ryanpeikou. The san ankou and other peikou cases are unaffected.
Install agari 0.24.0
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/agari-industries/agari/releases/download/v0.24.0/agari-installer.sh | sh
San Ankou on ron: A triplet completed by the winning tile on a ron is an open meld (minko) and no longer counts toward San Ankou when the only sequence covering the winning tile is an open called chi. Previously an open hand such as 111777m999p55z with a called (678m) chi, ron on 7m, was wrongly scored as San Ankou; it is now correctly yakuless. The legitimate case where the winning tile could instead complete a concealed sequence (leaving the same-value triplet concealed) still scores San Ankou. Suuankou is unaffected.
Install agari 0.23.0
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/agari-industries/agari/releases/download/v0.23.0/agari-installer.sh | sh
Uncapped Yakuman Stacking: Combined yakuman hands now stack by unit count with no cap, completing the full-scoring variant (8000 basic points per yakuman unit). A triple yakuman scores 24000 basic (non-dealer ron 96000), a quadruple 32000 (128000), and so on. Single yakuman (8000), the four double-yakuman patterns (16000), and counted/kazoe yakuman (always single, 8000) are unchanged. The ScoreLevel::Yakuman / ScoreLevel::DoubleYakuman variants are replaced by a single ScoreLevel::Yakuman(u8) carrying the unit count.
Fixed
Double Yakuman Scoring: Daisuushii (Big Four Winds) now scores 26 han (double yakuman) instead of 13, both closed and open. Suuankou Tanki is now emitted on tanki waits: a ron-completed suuankou (inherently tanki) and a tsumo completing the pair both score the double-yakuman SuuankouTanki (26 han), while a tsumo completing a triplet remains single Suuankou (13 han)
Install agari 0.22.0
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/agari-industries/agari/releases/download/v0.22.0/agari-installer.sh | sh
Shanten Meld Extraction: Replaced greedy dual-pass meld extraction with recursive backtracking to fix incorrect shanten values for certain hands (e.g., hands with kanchan taatsu like 46789m were miscounted)
Install agari 0.21.0
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rysb-dev/agari/releases/download/v0.21.0/agari-installer.sh | sh
Python Bindings (agari-python crate): New agari-python crate providing PyO3-based Python bindings for shanten and ukeire calculations, along with general-purpose mahjong utilities (chi/kan helpers, tile parsing, etc.)
Changed
Chi/Kan Utilities Moved to agari-core: Chi and kan utility functions previously in agari-python have been moved into the agari-core library for broader reuse
Fixed
Cargo Clippy Warnings: Resolved all outstanding cargo clippy warnings in agari-core and agari-python
Install agari 0.20.0
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rysb-dev/agari/releases/download/v0.20.0/agari-installer.sh | sh
Practical Ukeire Zero-Available Waits: Fixed ukeire excluding valid wait tiles when all copies were accounted for (hand + visible). A tile that improves shanten now always appears in the results even when 0 copies remain in the wall, so players can see their full wait shape.
Install agari 0.19.1
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rysb-dev/agari/releases/download/v0.19.1/agari-installer.sh | sh
Practical Ukeire (Tile Acceptance): New calculate_ukeire_with_visible and calculate_ukeire_with_melds_and_visible library functions that account for tiles already visible on the table (discard ponds, open melds, dora indicators). Available copies are computed as 4 - hand_count - visible_count instead of the theoretical 4 - hand_count.
--visible CLI Flag: New --visible <TILES> option for practical ukeire from the command line. Pass comma-separated visible tiles (e.g., --visible 2z,2z,5p) to subtract them from the available pool when computing ukeire.
Changed
Ukeire Documentation: Updated doc comments on all ukeire functions and UkeireTile::available to clarify the difference between theoretical and practical ukeire. Updated README with practical ukeire examples for both CLI and library usage.
Install agari 0.19.0
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rysb-dev/agari/releases/download/v0.19.0/agari-installer.sh | sh