Files
scrabble-solver/scrabble/apply.go
T
Ilia Denisov 15c7959d96 Implement Scrabble move generator (DAWG) with English and Russian rules
A Go library that returns every legal play ranked by score and scores or
validates plays, using the Appel-Jacobson DAWG algorithm over
github.com/iliadenisov/dafsa v1.1.0.

- DAWG move generation (across / down / both), full tournament scoring with a
  per-tile breakdown; public Solver: GenerateMoves (ranked), ScorePlay,
  ValidatePlay.
- Rulesets: English Scrabble, Russian Scrabble, Эрудит (parameterizable Ruleset).
- cmd/builddict (build the DAWG from the dictionaries submodule), cmd/stress
  (self-play benchmark), selfplay engine; brute-force test oracle.
- A GADDAG was implemented, benchmarked and removed (the DAWG was smaller and
  faster for a scoring solver); see RESULTS.md and ALGORITHM.md.
2026-06-01 16:07:32 +02:00

15 lines
389 B
Go

package scrabble
import (
"scrabble-solver/board"
"scrabble-solver/internal/encoding"
)
// Apply places a move's newly-placed tiles on the board. The move must be legal for the
// board (as produced by a generator, or validated); Apply does not re-check it.
func Apply(b *board.Board, m Move) {
for _, t := range m.Tiles {
b.Set(t.Row, t.Col, encoding.Cell(t.Letter, t.Blank))
}
}