ritchie/hand/yaku

Yaku types and their scoring values. Detection lives in ritchie/hand/yaku/detect.

Types

pub type Yaku {
  Riichi(double: Bool)
  Ippatsu
  MenzenTsumo
  Haitei
  Houtei
  Rinshan
  Chankan
  Tenhou
  Chiihou
  Pinfu
  Tanyao
  Iipeikou
  Ryanpeikou
  YakuhaiDragon(tile: tile.Tile)
  YakuhaiSeatWind(tile: tile.Tile)
  YakuhaiRoundWind(tile: tile.Tile)
  SanshokuDoujun(closed: Bool)
  SanshokuDoukou
  Ittsu(closed: Bool)
  Chanta(closed: Bool)
  Junchan(closed: Bool)
  Toitoi
  Sanankou
  Sankantsu
  Shousangen
  Honroutou
  Honitsu(closed: Bool)
  Chinitsu(closed: Bool)
  Chiitoitsu
  Kokushi
  Kokushi13
  Suuankou
  SuuankouTanki
  Daisangen
  Daisuushi
  Shousuushi
  Tsuuiisou
  Chinroutou
  Ryuuiisou
  Chuurenpoutou
  Junseichuurenpoutou
  Suukantsu
}

Constructors

  • Riichi(double: Bool)

    Win when riichi is declared. Double riichi means riichi in the initial round.

  • Ippatsu

    Win before first riichi discard.

  • MenzenTsumo

    Tsumo with closed hand.

  • Haitei

    Tsumo on the last tile of the live wall.

  • Houtei

    Ron on the last discard.

  • Rinshan

    Tsumo on the replacement tile after a kan.

  • Chankan

    Ron on a tile used for another player’s kan.

  • Tenhou

    Dealer win on the first turn. Yakuman.

  • Chiihou

    Non-dealer win on the first turn. Yakuman.

  • Pinfu

    Hand without fu.

  • Tanyao

    Hand without terminals and honors.

  • Iipeikou

    Hand with two identical sequences. Closed only.

  • Ryanpeikou

    Hand with three identical sequences. Closed only.

  • YakuhaiDragon(tile: tile.Tile)

    Yakuhai with dragon triplet.

  • YakuhaiSeatWind(tile: tile.Tile)

    Yakuhai with seat wind triplet.

  • YakuhaiRoundWind(tile: tile.Tile)

    Yakuhai with round wind triplet.

  • SanshokuDoujun(closed: Bool)

    Hand with three same-number sequences in different suits.

  • SanshokuDoukou

    Hand with three same-number triplets in different suits.

  • Ittsu(closed: Bool)

    Pure straight (1-9).

  • Chanta(closed: Bool)

    Hand where all tile groups contain a honor or terminal.

  • Junchan(closed: Bool)

    Hand where all tile groups contain a terminal.

  • Toitoi

    Hand with only triplets.

  • Sanankou

    Hand with three closed triplets.

  • Sankantsu

    Hand with three quads.

  • Shousangen

    Hand with three dragon triplets.

  • Honroutou

    Hand with only terminals and honors.

  • Honitsu(closed: Bool)

    Hand with one single suit and honor tiles.

  • Chinitsu(closed: Bool)

    Hand with only one single suit.

  • Chiitoitsu

    Seven unique pairs.

  • Kokushi

    Thirteen orphans with a single wait. Yakuman.

  • Kokushi13

    Thirteen orphans with a thirteen-sided wait. Yakuman.

  • Suuankou

    Four closed triplets. Yakuman.

  • SuuankouTanki

    Four closed triplets with a pair wait. Yakuman.

  • Daisangen

    Three dragon triplets. Yakuman.

  • Daisuushi

    Four wind triplets. Yakuman.

  • Shousuushi

    Three wind triplets and a wind pair. Yakuman.

  • Tsuuiisou

    Hand with only honor tiles. Yakuman.

  • Chinroutou

    Hand with only terminal tiles. Yakuman.

  • Ryuuiisou

    Hand with only green tiles. Yakuman.

  • Chuurenpoutou

    Nine gates. Yakuman.

  • Junseichuurenpoutou

    Pure nine gates. Yakuman.

  • Suukantsu

    Four quads. Yakuman.

The scoring value of a yaku: either han, or whole yakuman multiples.

pub type YakuValue {
  Han(Int)
  Yakuman(Int)
}

Constructors

  • Han(Int)
  • Yakuman(Int)

Values

pub fn han(yaku: Yaku) -> Int

Returns the han value of a single yaku, or 0 for yakuman.

pub fn is_double_yakuman(yaku: Yaku) -> Bool

Returns whether this yakuman may be worth double under rulesets that allow double yakuman.

pub fn is_yakuman(yaku: Yaku) -> Bool

Returns whether the yaku is a yakuman.

pub fn total_han(yakus: List(Yaku)) -> Int

Returns the total han value of a list of (non-yakuman) yaku.

pub fn value(yaku: Yaku) -> YakuValue

Returns the scoring value of a single yaku.

✨ Search Document