B7.4.1 · dive 1 of 3 · module B7.4
Distance and points.
For each emoji in the duplicate-free secret, the gap between where the player placed it and where it belongs maps to points — a hundred for exact, stepping down by twenty per position to zero — and scoring is a policy the game carries.
The idea
codemojex · distance and pointsScoring rewards how close a guess is, position by position. For each emoji in the secret, the reference implementation finds where the player placed that same emoji and measures the gap in positions. An exact placement scores a hundred; one position off scores eighty; the points step down by twenty for each position of distance, to zero at five away or when the emoji is missing.
Because the secret holds no duplicates, each of its six emoji maps to at most one place in the guess, so the six contributions are independent and add up without ambiguity. The result is a single number for the guess, and the same emoji set that drew the secret bounds how far any guess can be from it.
Scoring is a policy, not a fixed rule. A classic live room uses this linear distance; a Golden Room runs a simplified variant that drops partial credit, because a blind game settles on accuracy at the close and a coarser measure is enough. The engine carries the scoring policy on the game, so changing how a guess is scored does not change anything else about the play path.
The doors
the sibling coursesEchoMQ — the protocol, in depth
The bus B3 narrates, taught rung by rung: the keyspace, the Lua inventory, and the 3.0 Stream Tier — XADD, XREADGROUP, XACK — with conformance on Valkey.
Redis Patterns Applied
The substrate patterns under the bus: sorted sets, atomic Lua moves, locks, and streams — the judgement layer.
/echo-persistenceEcho Persistence — the durable floor
Beneath the volatile tiers: the Graft page engine built twice, the commit-LSN loop, and the stream archive on Tigris. Where Part I says state lives somewhere, this says where it lives durably.
References
sources · relatedSources
- Mastermind — the code-breaking game and its scoringthe position-and-distance feedback this scoring descends from
- Helland — Life Beyond Distributed Transactions (CIDR 2007)the standings as a derived view, the recorded guesses as the record of truth
- Erlang/OTP — the gen_server behaviourthe scoring policy carried on a game behind its boundary
Related
- BCS — the course homethe law, the id anatomy, the chapter map
- Echo Persistencethe durable floor beneath the bus