Elo
Pure ELO ladder math — the rating step and expected-score curve any ranked/competitive feature wants. No clock, no I/O, no domain types: a rating is an Int, a bout is 1-v-opponent, and step returns the new rating. Deterministic and testable.
Extracted from Gaddi's local ranked ladder (Backlog #24). Domain-coupled bits (e.g. a difficulty→opponent-rating table) stay with the caller; only the generic math lives here.
Properties
Default upper clamp — ten RATING_SCALE steps above the floor, well past any casual ladder.
The ELO rating scale: a gap of this many points makes the stronger player a 10:1 favourite. 400 is ELO's own constant, not a tuning knob — changing it changes what a rating means.
Functions
One ELO step. Returns the NEW rating after a bout vs opponentRating, where won is the actual result. The change is k * (actual - expected), rounded so a win moves at least +1 and a loss at least -1 — STRICTLY monotonic in the result regardless of rounding — then clamped to [floor, ceiling].