scrabble: add single-word-per-turn rule via PlayOptions
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.
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
#character-encoding UTF-8
|
||||
#player1 p1 Player One
|
||||
#player2 p2 Player Two
|
||||
#note Single-word rule fixture ("multiple words per turn" off). After the opening, each AT
|
||||
#note stacks under the previous one, forming an invalid vertical cross-word (TT, then AAA /
|
||||
#note TTT, ...). Standard rules reject these; the single-word rule accepts them and scores
|
||||
#note the main word only. The +SCORE/CUMUL columns are main-word-only scores.
|
||||
>p1: ATEIOUN 8H AT +4 4
|
||||
>p2: ATRSEOD 9H AT +3 3
|
||||
>p1: ATLNGUP 10H AT +2 6
|
||||
>p2: ATCHIMB 11H AT +2 5
|
||||
Reference in New Issue
Block a user