mahjong.hand_calculating.yaku_list

Concrete Yaku subclasses for standard yaku (non-yakuman).

Each class implements is_condition_met() to test whether the pattern is present in a given hand decomposition.

For yakuman-level patterns see yakuman.

All classes are re-exported here for convenient access via from mahjong.hand_calculating.yaku_list import <ClassName>.

class mahjong.hand_calculating.yaku_list.AkaDora[source]

Bases: Yaku

赤ドラ: Red five.

yaku_id: int = 121

Unique numeric identifier for this yaku.

name: str = 'Aka Dora'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 1

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 1

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Return True unconditionally; this yaku is awarded by the hand evaluation logic.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.Chankan[source]

Bases: Yaku

搶槓: Win by robbing another player’s kan declaration.

yaku_id: int = 4

Unique numeric identifier for this yaku.

name: str = 'Chankan'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 1

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 1

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Return True unconditionally; this yaku is awarded by the hand evaluation logic.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.Chantai[source]

Bases: Yaku

混全帯么九: Every set must have at least one terminal or honor tile.

The pair must also be a terminal or honor. Must contain at least one sequence (123 or 789).

yaku_id: int = 28

Unique numeric identifier for this yaku.

name: str = 'Chantai'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 1

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 2

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Check whether every set contains a terminal or honor, with at least one chi.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.Chiitoitsu[source]

Bases: Yaku

七対子: Hand contains only pairs.

yaku_id: int = 34

Unique numeric identifier for this yaku.

name: str = 'Chiitoitsu'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_closed: int = 2

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Check whether the hand consists of seven pairs.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.Chinitsu[source]

Bases: Yaku

清一色: The hand contains tiles only from a single suit.

yaku_id: int = 39

Unique numeric identifier for this yaku.

name: str = 'Chinitsu'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 5

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 6

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Check whether the hand uses tiles from a single suit with no honors.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.Chun[source]

Bases: Yaku

中: Pon of red dragons.

yaku_id: int = 17

Unique numeric identifier for this yaku.

name: str = 'Yakuhai (chun)'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 1

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 1

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Check whether the hand contains a pon or kan of red dragons.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.DaburuOpenRiichi[source]

Bases: Yaku

ダブルオープン立直: Open riichi declared on the player’s first turn (optional rule).

yaku_id: int = 9

Unique numeric identifier for this yaku.

name: str = 'Double Open Riichi'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_closed: int = 3

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Return True unconditionally; this yaku is awarded by the hand evaluation logic.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.DaburuRiichi[source]

Bases: Yaku

ダブル立直: Riichi declared on the player’s first turn.

yaku_id: int = 8

Unique numeric identifier for this yaku.

name: str = 'Double Riichi'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_closed: int = 2

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Return True unconditionally; this yaku is awarded by the hand evaluation logic.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.Dora[source]

Bases: Yaku

ドラ: Bonus han from dora indicator tiles.

yaku_id: int = 120

Unique numeric identifier for this yaku.

name: str = 'Dora'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 1

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 1

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Return True unconditionally; this yaku is awarded by the hand evaluation logic.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.Haitei[source]

Bases: Yaku

海底撈月: Win by self-draw on the last tile from the wall.

yaku_id: int = 6

Unique numeric identifier for this yaku.

name: str = 'Haitei Raoyue'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 1

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 1

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Return True unconditionally; this yaku is awarded by the hand evaluation logic.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.Haku[source]

Bases: Yaku

白: Pon of white dragons.

yaku_id: int = 15

Unique numeric identifier for this yaku.

name: str = 'Yakuhai (haku)'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 1

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 1

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Check whether the hand contains a pon or kan of white dragons.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.Hatsu[source]

Bases: Yaku

發: Pon of green dragons.

yaku_id: int = 16

Unique numeric identifier for this yaku.

name: str = 'Yakuhai (hatsu)'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 1

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 1

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Check whether the hand contains a pon or kan of green dragons.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.Honitsu[source]

Bases: Yaku

混一色: The hand contains tiles from a single suit plus honors.

yaku_id: int = 36

Unique numeric identifier for this yaku.

name: str = 'Honitsu'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 2

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 3

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Check whether the hand uses only one suit plus honor tiles.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.Honroto[source]

Bases: Yaku

混老頭: All tiles are terminals or honors.

yaku_id: int = 29

Unique numeric identifier for this yaku.

name: str = 'Honroutou'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 2

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 2

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Check whether all tiles in the hand are terminals or honors.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.Houtei[source]

Bases: Yaku

河底撈魚: Win on the last discard of the round.

yaku_id: int = 7

Unique numeric identifier for this yaku.

name: str = 'Houtei Raoyui'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 1

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 1

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Return True unconditionally; this yaku is awarded by the hand evaluation logic.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.Iipeiko[source]

Bases: Yaku

一盃口: Hand with two identical chi.

yaku_id: int = 14

Unique numeric identifier for this yaku.

name: str = 'Iipeiko'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_closed: int = 1

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Check whether the hand contains two identical chi sequences.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.Ippatsu[source]

Bases: Yaku

一発: Win within one turn of declaring riichi.

yaku_id: int = 3

Unique numeric identifier for this yaku.

name: str = 'Ippatsu'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_closed: int = 1

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Return True unconditionally; this yaku is awarded by the hand evaluation logic.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.Ittsu[source]

Bases: Yaku

一気通貫: Three sets of same suit: 1-2-3, 4-5-6, 7-8-9.

yaku_id: int = 27

Unique numeric identifier for this yaku.

name: str = 'Ittsu'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 1

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 2

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Check whether the hand contains 1-2-3, 4-5-6, and 7-8-9 sequences of the same suit.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.Junchan[source]

Bases: Yaku

純全帯么九: Every set must have at least one terminal, and the pair must be a terminal.

Must contain at least one sequence (123 or 789). Honors are not allowed.

yaku_id: int = 37

Unique numeric identifier for this yaku.

name: str = 'Junchan'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 2

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 3

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Check whether every set contains a terminal, with at least one chi and no honors.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.NagashiMangan[source]

Bases: Yaku

流し満貫: All discards are terminals and honors with no calls against them.

yaku_id: int = 10

Unique numeric identifier for this yaku.

name: str = 'Nagashi Mangan'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 5

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 5

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Return True unconditionally; this yaku is awarded by the hand evaluation logic.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.OpenRiichi[source]

Bases: Yaku

オープン立直: Open riichi declaration where the hand is revealed (optional rule).

yaku_id: int = 2

Unique numeric identifier for this yaku.

name: str = 'Open Riichi'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_closed: int = 2

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Return True unconditionally; this yaku is awarded by the hand evaluation logic.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.Pinfu[source]

Bases: Yaku

平和: All sequences with a valueless pair and a two-sided wait.

yaku_id: int = 12

Unique numeric identifier for this yaku.

name: str = 'Pinfu'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_closed: int = 1

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Return True unconditionally; this yaku is awarded by the hand evaluation logic.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.Renhou[source]

Bases: Yaku

人和: Non-dealer wins on the first go-around before any calls (optional rule).

yaku_id: int = 11

Unique numeric identifier for this yaku.

name: str = 'Renhou'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_closed: int = 5

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Return True unconditionally; this yaku is awarded by the hand evaluation logic.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.Riichi[source]

Bases: Yaku

立直: Declared ready hand.

yaku_id: int = 1

Unique numeric identifier for this yaku.

name: str = 'Riichi'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_closed: int = 1

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Return True unconditionally; this yaku is awarded by the hand evaluation logic.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.Rinshan[source]

Bases: Yaku

嶺上開花: Win on a replacement tile after calling kan.

yaku_id: int = 5

Unique numeric identifier for this yaku.

name: str = 'Rinshan Kaihou'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 1

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 1

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Return True unconditionally; this yaku is awarded by the hand evaluation logic.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.RoundWindEast[source]

Bases: Yaku

場風牌 東: Pon of round wind east.

yaku_id: int = 22

Unique numeric identifier for this yaku.

name: str = 'Yakuhai (round wind east)'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 1

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 1

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, round_wind, *args)[source]

Check whether the hand contains a pon or kan of the round wind.

Parameters:
  • hand (Collection[Sequence[int]]) – decomposed hand as a collection of tile groups in 34-format

  • round_wind (int | None) – tile index in 34-format of the round wind

Returns:

True if the round wind matches and the hand has a pon or kan of it

Return type:

bool

class mahjong.hand_calculating.yaku_list.RoundWindNorth[source]

Bases: Yaku

場風牌 北: Pon of round wind north.

yaku_id: int = 25

Unique numeric identifier for this yaku.

name: str = 'Yakuhai (round wind north)'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 1

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 1

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, round_wind, *args)[source]

Check whether the hand contains a pon or kan of the round wind.

Parameters:
  • hand (Collection[Sequence[int]]) – decomposed hand as a collection of tile groups in 34-format

  • round_wind (int | None) – tile index in 34-format of the round wind

Returns:

True if the round wind matches and the hand has a pon or kan of it

Return type:

bool

class mahjong.hand_calculating.yaku_list.RoundWindSouth[source]

Bases: Yaku

場風牌 南: Pon of round wind south.

yaku_id: int = 23

Unique numeric identifier for this yaku.

name: str = 'Yakuhai (round wind south)'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 1

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 1

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, round_wind, *args)[source]

Check whether the hand contains a pon or kan of the round wind.

Parameters:
  • hand (Collection[Sequence[int]]) – decomposed hand as a collection of tile groups in 34-format

  • round_wind (int | None) – tile index in 34-format of the round wind

Returns:

True if the round wind matches and the hand has a pon or kan of it

Return type:

bool

class mahjong.hand_calculating.yaku_list.RoundWindWest[source]

Bases: Yaku

場風牌 西: Pon of round wind west.

yaku_id: int = 24

Unique numeric identifier for this yaku.

name: str = 'Yakuhai (round wind west)'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 1

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 1

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, round_wind, *args)[source]

Check whether the hand contains a pon or kan of the round wind.

Parameters:
  • hand (Collection[Sequence[int]]) – decomposed hand as a collection of tile groups in 34-format

  • round_wind (int | None) – tile index in 34-format of the round wind

Returns:

True if the round wind matches and the hand has a pon or kan of it

Return type:

bool

class mahjong.hand_calculating.yaku_list.Ryanpeikou[source]

Bases: Yaku

二盃口: Two pairs of identical chi sequences (two iipeiko in the same hand).

yaku_id: int = 38

Unique numeric identifier for this yaku.

name: str = 'Ryanpeikou'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_closed: int = 3

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Check whether the hand contains two pairs of identical chi sequences.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.SanKantsu[source]

Bases: Yaku

三槓子: The hand with three kan sets.

yaku_id: int = 32

Unique numeric identifier for this yaku.

name: str = 'San Kantsu'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 2

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 2

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, melds, *args)[source]

Check whether the hand contains three kan sets.

Parameters:
  • hand (Collection[Sequence[int]]) – decomposed hand as a collection of tile groups in 34-format

  • melds (Collection[Meld]) – declared melds

Returns:

True if three of the melds are kan or shouminkan

Return type:

bool

class mahjong.hand_calculating.yaku_list.Sanankou[source]

Bases: Yaku

三暗刻: Three closed pon sets, the other sets need not be closed.

yaku_id: int = 31

Unique numeric identifier for this yaku.

name: str = 'San Ankou'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 2

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 2

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, win_tile, melds, is_tsumo)[source]

Check whether the hand contains three closed pon or kan sets.

Parameters:
  • hand (Collection[Sequence[int]]) – decomposed hand as a collection of tile groups in 34-format

  • win_tile (int) – winning tile index in 136-format

  • melds (Collection[Meld]) – declared melds

  • is_tsumo (bool) – True if the win is by self-draw

Returns:

True if the hand contains exactly three closed pon or kan sets

Return type:

bool

class mahjong.hand_calculating.yaku_list.Sanshoku[source]

Bases: Yaku

三色同順: The same chi in three suits.

yaku_id: int = 26

Unique numeric identifier for this yaku.

name: str = 'Sanshoku Doujun'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 1

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 2

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Check whether the hand contains the same chi sequence in all three suits.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.SanshokuDoukou[source]

Bases: Yaku

三色同刻: Three pon sets consisting of the same numbers in all three suits.

yaku_id: int = 33

Unique numeric identifier for this yaku.

name: str = 'Sanshoku Doukou'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 2

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 2

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Check whether the hand contains pon or kan sets of the same number in all three suits.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.SeatWindEast[source]

Bases: Yaku

自風牌 東: Pon of seat wind east.

yaku_id: int = 18

Unique numeric identifier for this yaku.

name: str = 'Yakuhai (seat wind east)'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 1

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 1

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, player_wind, *args)[source]

Check whether the hand contains a pon or kan of the seat wind.

Parameters:
  • hand (Collection[Sequence[int]]) – decomposed hand as a collection of tile groups in 34-format

  • player_wind (int | None) – tile index in 34-format of the player’s seat wind

Returns:

True if the player’s seat wind matches and the hand has a pon or kan of it

Return type:

bool

class mahjong.hand_calculating.yaku_list.SeatWindNorth[source]

Bases: Yaku

自風牌 北: Pon of seat wind north.

yaku_id: int = 21

Unique numeric identifier for this yaku.

name: str = 'Yakuhai (seat wind north)'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 1

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 1

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, player_wind, *args)[source]

Check whether the hand contains a pon or kan of the seat wind.

Parameters:
  • hand (Collection[Sequence[int]]) – decomposed hand as a collection of tile groups in 34-format

  • player_wind (int | None) – tile index in 34-format of the player’s seat wind

Returns:

True if the player’s seat wind matches and the hand has a pon or kan of it

Return type:

bool

class mahjong.hand_calculating.yaku_list.SeatWindSouth[source]

Bases: Yaku

自風牌 南: Pon of seat wind south.

yaku_id: int = 19

Unique numeric identifier for this yaku.

name: str = 'Yakuhai (seat wind south)'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 1

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 1

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, player_wind, *args)[source]

Check whether the hand contains a pon or kan of the seat wind.

Parameters:
  • hand (Collection[Sequence[int]]) – decomposed hand as a collection of tile groups in 34-format

  • player_wind (int | None) – tile index in 34-format of the player’s seat wind

Returns:

True if the player’s seat wind matches and the hand has a pon or kan of it

Return type:

bool

class mahjong.hand_calculating.yaku_list.SeatWindWest[source]

Bases: Yaku

自風牌 西: Pon of seat wind west.

yaku_id: int = 20

Unique numeric identifier for this yaku.

name: str = 'Yakuhai (seat wind west)'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 1

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 1

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, player_wind, *args)[source]

Check whether the hand contains a pon or kan of the seat wind.

Parameters:
  • hand (Collection[Sequence[int]]) – decomposed hand as a collection of tile groups in 34-format

  • player_wind (int | None) – tile index in 34-format of the player’s seat wind

Returns:

True if the player’s seat wind matches and the hand has a pon or kan of it

Return type:

bool

class mahjong.hand_calculating.yaku_list.Shosangen[source]

Bases: Yaku

小三元: Hand with two dragon pon sets and one dragon pair.

yaku_id: int = 35

Unique numeric identifier for this yaku.

name: str = 'Shou Sangen'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 2

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 2

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Check whether the hand has two dragon pon or kan sets and one dragon pair.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.Tanyao[source]

Bases: Yaku

断么九: Hand without 1, 9, dragons and winds.

yaku_id: int = 13

Unique numeric identifier for this yaku.

name: str = 'Tanyao'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 1

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 1

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Check whether all tiles in the hand are simple tiles (no terminals or honors).

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.Toitoi[source]

Bases: Yaku

対々和: The hand consists of all pon sets (and of course a pair), no sequences.

yaku_id: int = 30

Unique numeric identifier for this yaku.

name: str = 'Toitoi'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_open: int = 2

Han awarded for open hands. 0 means the yaku is not available when the hand is open.

han_closed: int = 2

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Check whether the hand contains four pon or kan sets.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.Tsumo[source]

Bases: Yaku

門前清自摸和: Win by self-draw with a closed hand.

yaku_id: int = 0

Unique numeric identifier for this yaku.

name: str = 'Menzen Tsumo'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_closed: int = 1

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Return True unconditionally; this yaku is awarded by the hand evaluation logic.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool

class mahjong.hand_calculating.yaku_list.UraDora[source]

Bases: Yaku

裏ドラ: Bonus han from ura dora indicators revealed after a riichi win.

yaku_id: int = 122

Unique numeric identifier for this yaku.

name: str = 'Ura Dora'

Display name of the yaku (e.g., "Tanyao", "Kokushi Musou").

han_closed: int = 1

Han awarded for closed hands. 0 means the yaku is not available when the hand is closed.

is_condition_met(hand, *args)[source]

Return True unconditionally; this yaku is awarded by the hand evaluation logic.

Parameters:

hand (Collection[Sequence[int]])

Return type:

bool