scrabble: single-word rule requires in-line connection #3

Merged
developer merged 1 commits from feature/single-word-connectivity into master 2026-06-14 12:46:10 +00:00
Owner

Under PlayOptions.IgnoreCrossWords a play connected to the board through any perpendicular contact, even one forming a non-word, because connected() reused the standard rule's touchesPerpendicular test while cross-words were suppressed. An all-new word that merely abutted the board sideways was accepted, and the generator (relaxed cross-sets) offered such plays.

Fix: under IgnoreCrossWords the main word must run through an existing tile along the play direction (len(Main) > len(Tiles)); generated moves are filtered by the same predicate so generation agrees with ValidatePlayOpts. Standard rules are unchanged (the brute-force oracle test still passes).

Consumed by scrabble-game as the single-word-per-turn fix; pinned there as v1.1.1 after merge.

Tests: go test ./... green; gofmt/go vet clean.

Under `PlayOptions.IgnoreCrossWords` a play connected to the board through any perpendicular contact, even one forming a non-word, because `connected()` reused the standard rule's `touchesPerpendicular` test while cross-words were suppressed. An all-new word that merely abutted the board sideways was accepted, and the generator (relaxed cross-sets) offered such plays. **Fix:** under `IgnoreCrossWords` the main word must run through an existing tile along the play direction (`len(Main) > len(Tiles)`); generated moves are filtered by the same predicate so generation agrees with `ValidatePlayOpts`. Standard rules are unchanged (the brute-force oracle test still passes). Consumed by scrabble-game as the single-word-per-turn fix; pinned there as `v1.1.1` after merge. Tests: `go test ./...` green; `gofmt`/`go vet` clean.
developer added 1 commit 2026-06-14 12:40:14 +00:00
Under PlayOptions.IgnoreCrossWords a play connected to the board through any
perpendicular contact, even one forming a non-word, because connected() reused
the standard rule's touchesPerpendicular test while cross-words were suppressed.
That let an all-new word merely abut the board sideways and be accepted, and the
generator, with relaxed cross-sets, offered such plays.

Require the main word to run through an existing tile along the play direction
when cross-words are ignored, and filter generated moves by the same predicate so
generation agrees with ValidatePlayOpts. Standard rules are unchanged.
owner approved these changes 2026-06-14 12:45:19 +00:00
developer merged commit bf48d3c915 into master 2026-06-14 12:46:10 +00:00
developer deleted branch feature/single-word-connectivity 2026-06-14 12:46:10 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: developer/scrabble-solver#3