Skip to content

fix: Add validation for hand decomposition#190

Merged
Nihisil merged 10 commits intoMahjongRepository:masterfrom
Apricot-S:fix/divider-bug
Feb 7, 2026
Merged

fix: Add validation for hand decomposition#190
Nihisil merged 10 commits intoMahjongRepository:masterfrom
Apricot-S:fix/divider-bug

Conversation

@Apricot-S
Copy link
Collaborator

#171

Added validation for hand decomposition.
This ensures that if the hand decomposition is successful, the hand is Agari, and if it fails, the hand is not Agari (except for Kokushi Musou).

Also added comments explaining how the algorithm automatically rejects invalid hands.

@Apricot-S Apricot-S added this to the v2.0.0 milestone Feb 6, 2026
@Apricot-S Apricot-S requested a review from Nihisil February 6, 2026 19:45
@Apricot-S Apricot-S self-assigned this Feb 6, 2026
@Apricot-S Apricot-S added the bug label Feb 6, 2026
@Apricot-S Apricot-S changed the title Fix/divider bug fix: Add validation for hand decomposition Feb 6, 2026
@Apricot-S
Copy link
Collaborator Author

Sorry, there was a lack of validation when melds is present.

I added a test case first.
I'll consider adding validation later.

@Apricot-S
Copy link
Collaborator Author

Validation added.

Copy link
Contributor

@Nihisil Nihisil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great fix, thank you

@Nihisil Nihisil merged commit 25bf673 into MahjongRepository:master Feb 7, 2026
8 checks passed
@Apricot-S Apricot-S deleted the fix/divider-bug branch February 7, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants