Files
scrabble-game/ui/src/lib/dict/testdata/sample_en.words.json
T
Ilia Denisov c334a9d7b7
CI / changes (pull_request) Successful in 1s
CI / unit (pull_request) Successful in 10s
CI / integration (pull_request) Successful in 15s
CI / ui (pull_request) Successful in 1m8s
CI / conformance (pull_request) Successful in 9s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m38s
feat(offline): port DAWG cursor + move generator to TS (parity-pinned)
First engine-first step of PWA offline mode (Phase A): the client-side move
generator — the "robot brain" a local vs_ai game will run on-device — with no
runtime wiring yet (Phase B).

- dawg.ts: add the step-by-step cursor (root/final/next/arcs), a faithful port
  of dafsa traverse.go over the reader's existing bitstream.
- generate.ts: the Appel-Jacobson generator (leftPart/extendRight + cross-sets +
  counts-rack + board transpose + moveKey ranking), reusing the cursor and
  validate.ts evaluate/connected. A cross-set LetterSet is a Uint8Array, so the
  33-letter Russian alphabet (index 32) is exact under JS bit ops.
- validate.ts: export connected for the generator's connectivity filter.
- backend/cmd/movegen: dev tool building small sample dictionaries and emitting
  golden move-generation fixtures from the real Go solver (EN + RU).
- tests: dawg.cursor.test.ts (enumeration bijection vs indexOf) and
  generate.parity.test.ts (7/7 vs the Go solver: empty board, mid-game, blank,
  single-word rule, Russian index-32 cross-set). The committed EN sample also
  unblocks the existing skipped dawg.parity.test.ts once wired with DICT_* in CI.

Pure additive library code; no runtime behavior change.
2026-07-06 01:35:11 +02:00

123 lines
1.0 KiB
JSON

{
"alphabet": "en",
"numAdded": 18,
"words": [
"a",
"an",
"and",
"ant",
"car",
"care",
"cared",
"cares",
"cars",
"cat",
"cats",
"do",
"doe",
"does",
"dog",
"dogs",
"done",
"dot"
],
"indexes": [
[
0
],
[
0,
13
],
[
0,
13,
3
],
[
0,
13,
19
],
[
2,
0,
17
],
[
2,
0,
17,
4
],
[
2,
0,
17,
4,
3
],
[
2,
0,
17,
4,
18
],
[
2,
0,
17,
18
],
[
2,
0,
19
],
[
2,
0,
19,
18
],
[
3,
14
],
[
3,
14,
4
],
[
3,
14,
4,
18
],
[
3,
14,
6
],
[
3,
14,
6,
18
],
[
3,
14,
13,
4
],
[
3,
14,
19
]
]
}