scrabble: single-word-per-turn rule via PlayOptions #2

Merged
developer merged 1 commits from feat/single-word-rule into master 2026-06-12 07:18:49 +00:00
Owner

Adds an optional single word per turn rule (PlayOptions{IgnoreCrossWords}): only the main word along the play direction is validated and scored; perpendicular cross-words are neither formed, validated, scored, nor used to constrain move generation. The zero PlayOptions stays standard Scrabble, so existing callers are unchanged.

  • Threaded through new EvaluateOpts, Solver.{ScorePlay,ValidatePlay,GenerateMoves}Opts and the DAWG generator (relaxed cross-sets via fullSet, main-word-only scoring).
  • connected() now tests perpendicular adjacency directly instead of via Move.Cross, so an all-new main word touching the board only sideways still connects when cross-words are suppressed (behaviour-preserving for standard play).
  • Tests: focused corner-case suite (solver_opts_test.go) + a single-word GCG fixture; the 17 real-game GCG fixtures stay green as the standard-rules regression guard.

This is the engine dependency for scrabble-game's "multiple words per turn" feature; once merged it is tagged v1.1.0 (minor, backward-compatible).

Adds an optional **single word per turn** rule (`PlayOptions{IgnoreCrossWords}`): only the main word along the play direction is validated and scored; perpendicular cross-words are neither formed, validated, scored, nor used to constrain move generation. The zero `PlayOptions` stays standard Scrabble, so existing callers are unchanged. - Threaded through new `EvaluateOpts`, `Solver.{ScorePlay,ValidatePlay,GenerateMoves}Opts` and the DAWG generator (relaxed cross-sets via `fullSet`, main-word-only scoring). - `connected()` now tests perpendicular adjacency directly instead of via `Move.Cross`, so an all-new main word touching the board only sideways still connects when cross-words are suppressed (behaviour-preserving for standard play). - Tests: focused corner-case suite (`solver_opts_test.go`) + a single-word GCG fixture; the 17 real-game GCG fixtures stay green as the standard-rules regression guard. This is the engine dependency for scrabble-game's "multiple words per turn" feature; once merged it is tagged **v1.1.0** (minor, backward-compatible).
developer added 1 commit 2026-06-12 07:08:37 +00:00
Add an optional "single word per turn" rule: only the main word along the
play direction is validated and scored; perpendicular cross-words are ignored
— not formed, validated, scored, or used to constrain move generation. The
zero PlayOptions stays standard Scrabble, so existing callers are unchanged.

- PlayOptions{IgnoreCrossWords} threaded through new EvaluateOpts,
  Solver.{ScorePlay,ValidatePlay,GenerateMoves}Opts and the DAWG generator
  (relaxed cross-sets via fullSet, main-word-only scoring).
- connected() tests perpendicular adjacency directly instead of via
  Move.Cross, so an all-new main word touching the board only sideways still
  connects when cross-words are suppressed (behaviour-preserving for standard
  play).
- Tests: focused corner-case suite (solver_opts_test.go) and a single-word
  GCG fixture; the 17 real-game GCG fixtures stay green as the standard-rules
  regression guard.
owner approved these changes 2026-06-12 07:17:47 +00:00
developer merged commit a1fd200d97 into master 2026-06-12 07:18:49 +00:00
developer deleted branch feat/single-word-rule 2026-06-12 07:18:49 +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#2