fix(engine): single-word rule connects along the play line #57
Reference in New Issue
Block a user
Delete Branch "feature/single-word-connectivity"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes the contour bug where a single-word-per-turn game accepted plays that merely touched existing tiles sideways without forming a word along their own line (the reported РЮМ/КЕД/ОР placements, where e.g. РЮМ's М abutted Н making the non-word ЕРСАНМ).
Root cause: under
IgnoreCrossWordsthe solver'sconnected()reused the standard rule'stouchesPerpendiculartest while cross-words were suppressed, so a purely perpendicular contact counted as a connection (and the generator offered such plays). Standard play was unaffected.Fix (engine
scrabble-solverv1.1.1, PR #3): under the single-word rule the main word must run through an existing tile along the play direction; generation is filtered by the same predicate. The rule is therefore no longer a superset of standard play (it forbids parallel plays the standard rule allows, and admits in-line plays whose cross-words are invalid).Backend: for a single tile that abuts the board on both axes,
playDirectionnow picks the higher-scoring legal orientation (horizontal on a tie) instead of the geometrically longer one, so a real word is never rejected in favour of a non-word.Reworked single-word tests (solver + engine), updated
ARCHITECTURE/FUNCTIONAL(_ru)/PRERELEASE(row MW2).Verified locally (against the published v1.1.1):
go build/vet/gofmtclean; backend unit + integration (-tags=integration, testcontainers) green.