testsAndMisc/kcd2_dice_solver/src
Krzysztof kuhy Rudnicki d39ad67323 Split kcd2 scoring.ts 361 -> 172 + move generator
The 114-line private moves() method was most of the file: it enumerates every
legal step from a position -- straights, badge formations, n-of-a-kind, lone
1s and 5s, and the two joker rules -- while Scorer just maximises over it and
caches the answers.

Extracted it to scoringMoves.ts (203) as a free function over ScoringConfig,
taking combinationValue with it (its only caller, and the home of the
Emperor/Tyche triple-only rule) plus the tripleBase/ofAKindValue helpers.
scoring.ts (172) keeps Scorer, its two caches and its two recursions.

moves() was private, so no consumer saw the seam; only scoring.test.ts moved,
for the two value helpers, import path only. Coverage totals are unchanged at
863/375/181/810 -- the generator's branches are all still exercised.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
2026-08-17 09:39:31 +02:00
..
components Split the kcd2_dice_solver test files under the cap 2026-08-16 20:03:33 +02:00
core Split kcd2 scoring.ts 361 -> 172 + move generator 2026-08-17 09:39:31 +02:00
data Split the kcd2_dice_solver data tables under the cap 2026-08-16 19:50:54 +02:00
hooks Track kcd2_dice_solver app and add run.sh dependency installer 2026-07-21 18:17:13 +02:00
lib Split the kcd2_dice_solver test files under the cap 2026-08-16 20:03:33 +02:00
test Split the kcd2_dice_solver test files under the cap 2026-08-16 20:03:33 +02:00
worker Track kcd2_dice_solver app and add run.sh dependency installer 2026-07-21 18:17:13 +02:00
App.tsx Split kcd2 search.ts 417 -> 100 + two modules 2026-08-17 09:26:42 +02:00
AppLinks.test.tsx Split the kcd2_dice_solver test files under the cap 2026-08-16 20:03:33 +02:00
AppRecovery.test.tsx Split the kcd2_dice_solver test files under the cap 2026-08-16 20:03:33 +02:00
AppShell.test.tsx Split the kcd2_dice_solver test files under the cap 2026-08-16 20:03:33 +02:00
AppStorage.test.tsx Split the kcd2_dice_solver test files under the cap 2026-08-16 20:03:33 +02:00
index.css kcd2 dice solver: serve it at dice.kuhy.duckdns.org, fit all 43 dice, move inventories between devices 2026-07-26 20:01:21 +02:00
main.tsx Track kcd2_dice_solver app and add run.sh dependency installer 2026-07-21 18:17:13 +02:00