Implement Scrabble move generator (DAWG) #1
Reference in New Issue
Block a user
Delete Branch "feat/scrabble-solver"
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?
A Go Scrabble solver: generates every legal play ranked by score, and scores/validates plays, using the Appel-Jacobson DAWG over github.com/iliadenisov/dafsa v1.1.0.
Highlights
Solver:GenerateMoves(ranked),ScorePlay,ValidatePlay.cmd/builddict,cmd/stress(self-play benchmark),selfplayengine; brute-force test oracle.RESULTS.md.Verification
go test ./...green,go vet/gofmtclean.cmd/builddictbuilds a ~732 KB DAWG from SOWPODS;cmd/stress~180k moves/s.Docs:
ALGORITHM.md(algorithm source of truth),PLAN.md,RESULTS.md,README.md. Thedictionariessubmodule references kamilmielnik/scrabble-dictionaries on GitHub.- cmd/builddict: add -alphabet latin|russian (russian = alphabet.Embedded(LangRu)). - dictprep/fold_yo.py: fold Ё→Е and de-dup, the Эрудит dictionary prep. - Makefile: `make dawg` rebuilds dawg/{en_sowpods,ru_scrabble,ru_erudit}.dawg. - dawg/: committed DAWGs verified by enumeration — 267752 / 83385 / 83343 words.Replay 17 real tournament games (cross-tables.com, including the 700+ club) and check, move for move, that: - ScorePlay reproduces the protocol score and running total exactly; - the move generator produces every dictionary-valid played move with that score. The GCG parser handles coordinates (across/down), blanks (lowercase), played-through tiles ("."), passes/exchanges, challenge bonuses, end-game rack adjustments and phony withdrawals ("--", un-applied). Uses the committed dawg/en_sowpods.dawg.