OddSmith
Expected-value calculator for chained d6 rolls (hit → wound → save → damage → FNP). Built with Test-Driven Development: domain logic in pure TypeScript, React UI with state-derived results, and controlled components. The result is computed on every render from state — no second copy to keep in sync.
Architecture
- ▸Domain layer: resolveSequence chains steps, resolveAttack joins pre- and post-damage phases
- ▸stepProbability exposed as a domain function, reused by both UI and domain
- ▸Attack/defence step split mirroring game rules (hit, wound, save, optional FNP)
- ▸Controlled components: StepRow and StepList store no state, result is derived from attacks and steps