any word graph, chosen by config name#94
Merged
Conversation
The CLI's <lexicon> argument picked from a small hardcoded table of lexicon-name-to-kwg-path pairs, so solving a position with any word list outside that table meant recompiling the binary. Split the two concerns apart: <config> now names only the alphabet, board layout, and tile set (english, catalan, dutch, french, german, norwegian, polish, slovene, spanish, or swedish) -- never a specific word list -- and a new <kwg-file> argument takes a path to any .kwg built for that config, loaded straight from disk. game_config_for_name replaces the old lexicon table for this purpose; solve_question (the hardcoded demo's own path, unchanged, still reads its own two lexicon kwg files by name) and the CLI both now delegate the actual solve to a shared solve_position(game_config, kwg, ...), a pure extraction of the word-prune-and-solve logic with no behavior change. score-diff moves to the 5th argument and its usage line spells out which way it points (ahead, negative if behind), following the config/kwg-file/fen/rack/score-diff argument order and hyphenated naming used throughout. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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.
Summary
the endgame CLI used to pick its word graph from a small hardcoded table that mapped a lexicon name to a .kwg path, so solving a position with any word list outside that table meant recompiling the binary. this splits the two concerns apart: the argument now names only the alphabet, board layout, and tile set (english, catalan, dutch, french, german, norwegian, polish, slovene, spanish, or swedish) and never a specific word list, while a new argument takes a path to any .kwg built for that config and loads it straight from disk. the accompanying lab/endgame.txt documentation is updated to describe choosing any word graph by config name.
Changes
Correctness
solve_question (the hardcoded demo's own path) is unchanged and still reads its own two lexicon kwg files by name; extracting solve_position carries no behavior change.