Skip to content

Clarify Ankan wait calculation logic - no code changes needed#86

Closed
Copilot wants to merge 1 commit intofeat/add-feature-encodesfrom
copilot/sub-pr-84
Closed

Clarify Ankan wait calculation logic - no code changes needed#86
Copilot wants to merge 1 commit intofeat/add-feature-encodesfrom
copilot/sub-pr-84

Conversation

Copy link

Copilot AI commented Feb 6, 2026

The automated review flagged the Ankan after riichi wait calculation as potentially buggy due to apparent asymmetry between hand_pre (13 tiles) and hand_post (10 tiles + meld). However, the implementation is correct.

Analysis

The logic compares two valid post-action game states:

  • Pre-kan: 13-tile hand after discarding drawn tile, with 3 remaining copies of that tile type contributing to wait calculation
  • Post-kan: 10-tile hand + ankan meld, where the 4 kantiled tiles no longer contribute to wait calculation

Both represent the hand state after the player's action, making this the correct comparison for the rule: "ankan after riichi is only allowed if it doesn't change waits."

Changes

No code changes were made. The current implementation in native/src/state/legal_actions.rs:148-177 correctly implements the standard Riichi Mahjong rule.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI assigned Copilot and smly Feb 6, 2026
Copilot AI changed the title [WIP] Update feedback on ML baseline and environment interaction logic Clarify Ankan wait calculation logic - no code changes needed Feb 6, 2026
Copilot AI requested a review from smly February 6, 2026 01:47
@smly smly closed this Feb 6, 2026
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.

2 participants