← All articles
Code Royale·August 15, 2026·6 min read

How Elo Rating Works (and Why Code Royale Uses It)

By Eduardo Dionisio

Elo is the rating system behind chess — and now behind Code Royale. Its core idea is simple and powerful: your rating is a number that predicts your expected score against anyone else, and every result moves both players' ratings in opposite directions.

Expected score

Given two ratings, Elo computes how likely each player is to win. A 400-point gap means the higher-rated player is expected to win about 90% of the time. Beating someone rated far above you is worth a lot; losing to them costs you little.

The update

text
new_rating = old_rating + K * (actual - expected)

actual is 1 for a win, 0 for a loss. expected is the predicted score from the two ratings. K is the sensitivity factor: a higher K means bigger swings per game. Code Royale keeps the pool zero-sum — what you gain, your opponent loses — so the ladder always sums to a constant and never inflates.

Why it matters for matchmaking

  • Ratings make fair matches: pair players with similar Elo and the result is genuinely uncertain.
  • Ratings make progress legible: every win nudges a concrete number, and badge tiers (Bronze → Platinum) map to it.
  • Per-arena ratings mean your Python skill and your DSA skill are tracked separately.

That is the whole appeal: a rating you can feel move after every battle. It's not an arbitrary score — it's a running statement of how you stack up, updated one match at a time.