scrabble: single-word rule requires in-line connection #3
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?
Under
PlayOptions.IgnoreCrossWordsa play connected to the board through any perpendicular contact, even one forming a non-word, becauseconnected()reused the standard rule'stouchesPerpendiculartest 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
IgnoreCrossWordsthe 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 withValidatePlayOpts. 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.1after merge.Tests:
go test ./...green;gofmt/go vetclean.