Skip to content

v0.3.0

Choose a tag to compare

@rysb-dev rysb-dev released this 29 Jan 01:44
· 79 commits to main since this release

Agari Release Notes

Highlights

This release brings significant improvements to CLI ergonomics, scoring accuracy, and output options. Major additions include intuitive honor tile notation, automatic winning tile inference, JSON output support, and better alignment with Tenhou's scoring rules.

New Features

Ergonomic Honor Tile Notation

You can now use intuitive letter-based notation for honor tiles instead of the numeric z notation:

  • Winds: e (East), s (South), w (West), n (North)
  • Dragons: wh (White), g (Green), r (Red)
  • Verbose names: east, south, haku, hatsu, chun, etc.

Works everywhere—hand strings, called melds, winning tile, dora, and ura dora:

# Before
agari "123m456p789s11144z" -w 1z -d 35z

# After  
agari "123m456p789seeenn" -w e -d wwh

The parser handles ambiguous sequences like wwhwwwh correctly (West, White, West, West, White).

Automatic Winning Tile Inference

When -w/--win is omitted, Agari now automatically infers the winning tile that maximizes your score. This fixes scoring mismatches where hands with Ryanpeikou weren't receiving Pinfu because the wait type was unknown.

# Agari now correctly awards Pinfu by inferring the optimal winning tile
agari "440566m334405p66s" --tsumo -r
# Result: 11 han / 20 fu / Sanbaiman (matches MahjongSoul)

JSON Output

New --json flag for machine-readable output, useful for integrating Agari into other tools:

agari "123m456p789s11122z" -r --json

Includes hand structure, yaku list with han values, dora breakdown, fu calculation, payment details, and full game context.

Grouped Dora Notation

Specify multiple dora indicators using standard mahjong notation:

agari "..." -d 58m --ura 29pg    # 5m, 8m as dora; 2p, 9p, green as ura
agari "..." -d 19mr              # 1m, 9m, red dragon as dora

Counted Yakuman Distinction

Hands reaching yakuman-level points (13+ han) through accumulated yaku are now labeled as "Counted Yakuman" (数え役満), distinguishing them from true yakuman patterns like Kokushi or Suuankou.

Input Validation Warnings

Helpful warnings when using riichi-dependent options without riichi:

⚠️  Warning: Ura dora (--ura) specified without riichi. Ura dora only apply when winning with riichi.
⚠️  Warning: Ippatsu (--ippatsu) specified without riichi. Ippatsu only applies when winning within one turn of riichi.

Bug Fixes

  • Interpretation selection: When multiple interpretations have equal payment, prefer higher han (e.g., Ryanpeikou over Chiitoitsu)
  • Suuankou scoring: All forms now scored as single yakuman to match Tenhou
  • Dora display: Ura dora and akadora now shown separately in yaku output
  • Kokushi display: Now shows all 14 tiles instead of just the pair
  • Winning tile validation: Rejects multi-tile input like 1m2m with helpful error
  • Validator: Ignores akadora markings when game has akadora disabled

Documentation

  • Added comprehensive "Using as a Library" guide to README
  • Added validator README with dataset source and usage instructions
  • Updated CLI help text with new notation examples

Test Coverage

Added 59 new tests covering:

  • Honor letter notation parsing (35 tests)
  • Winning tile inference scenarios (19 tests)
  • Riichi dependency validation (4 tests)
  • Edge cases for interpretation preference, sanankou, and nobetan fu

Total test count: 254

Full Changelog: v0.2.0...v0.3.0