Merged
Conversation
When a phony is challenged off, the analyzer now tracks and uses the revealed tiles when analyzing the opponent's next turn. This improves analysis accuracy by passing known rack information to the Monte Carlo simmer and pre-endgame solver. - Add KnownOppRack field to TurnAnalysis to record exposed tiles - Add UseExposedOppRacks config flag (enabled by default) - Extract and track exposed tiles from PHONY_TILES_RETURNED events - Pass known opponent rack to simmer and PEG solver via SetKnownOppRack() - Update protobuf definitions and generated code - Add go:generate directive for protobuf compilation Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Log when analyzing with known opponent rack from challenged phony to make it easier to verify the feature is working. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
When a phony containing blanks is challenged off, the blanks return to the rack as undesignated (shown as '?' rather than the letter they were played as). Use IntrinsicTileIdx() to convert blank-A to undesignated blank (0) so: - Solvers receive undesignated blanks in the known opponent rack - Display shows blanks as '?' (e.g., "?MERICA" not "aMERICA" or "AMERICA") Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Create AnalyzeSingleTurn method that can analyze a single turn without running full game analysis. This function: - Takes history, rules, and turn number - Handles all turn analysis logic (phony detection, known opp rack, etc.) - Can be called standalone or in a loop by AnalyzeGame Refactored AnalyzeGame to use AnalyzeSingleTurn in its loop, eliminating code duplication and making it easier to analyze individual turns. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add analyze-turn command to analyze a single turn in a loaded game without running full game analysis. This is much faster for debugging or examining specific positions. Changes: - Add AnalyzeSingleTurnFromHistory convenience wrapper in gameanalysis - Add analyzeTurn shell command with -turn flag - Add analyze-turn.txt help text - Update usage-standard.txt to list all analysis commands Usage: analyze-turn -turn <n> where n is the 0-indexed event number from game history Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Changed analyze-turn to analyze the current turn (from sc.game.Turn()) instead of requiring a -turn parameter. This is much more intuitive: - Navigate to a turn with 'n' and 'p' - Run 'analyze-turn' to analyze that position Updated help text to reflect this simpler usage. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
PrepareSim() was clearing knownOppRack to nil, so we need to call SetKnownOppRack AFTER PrepareSim, not before. This fixes the bug where the analyzer was not actually using the known opponent rack even though it logged that it was. Verified that the PEG solver does not have this issue - it does not clear knownOppRack in its Init or Solve methods. Also cleaned up excessive debug logging. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #456
fix #452 (duplicate)