Skip to content

fix(mahjong): allow chow without pong/gong and relax hu pair#334

Open
Shuo-O wants to merge 1 commit intodatamllab:masterfrom
Shuo-O:fix/mahjong-chow-hu
Open

fix(mahjong): allow chow without pong/gong and relax hu pair#334
Shuo-O wants to merge 1 commit intodatamllab:masterfrom
Shuo-O:fix/mahjong-chow-hu

Conversation

@Shuo-O
Copy link

@Shuo-O Shuo-O commented Jan 21, 2026

Summary

  • Enable chow availability when no pong/gong is triggered after a discard.
  • Allow HU to use a pair taken from a triplet (count >= 2), which matches standard pair selection.

Issues fixed

  1. Chow was skipped unless a pong/gong happened first.
  2. HU was rejected when the only pair could be taken from a 3/4-of-a-kind.

Changes

  • rlcard/games/mahjong/round.py
    • After a discard with no pong/gong, check judge_chow before dealing to the next player.
  • rlcard/games/mahjong/judger.py
    • Allow pair candidates with count >= 2 and remove only two tiles as the pair.

Tests

  • tests/games/test_mahjong_regressions.py
    • test_chow_available_without_pong_gong
    • test_hu_allows_pair_from_triplet

Notes

  • Rules remain simplified (no yaku/score handling); this only fixes legality detection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant