Codemojex · C2.2
The emoji set.
An emoji set is a sprite sheet plus the subset of cells a room exposes. It is the keyboard a player taps — and it is the space the secret is drawn from. A code is XXYY: column, then row, two digits each, addressing one cell on the sheet exactly as the frontend renders it.
Grounding — Codemojex.EmojiSet (xy/1 · code/2 · bg_position/2) · priv/repo/seeds.exs · the emoji-codes story.
XX, then row YYThe code
emoji_set.exColumn then row, two digits each. The pair round-trips, the whole grid expands row-major, and the pixel offset is (-x·cell_size, -y·cell_size) — the same arithmetic the frontend uses to place the cell.
iex> Codemojex.EmojiSet.xy("0305") {3, 5} iex> Codemojex.EmojiSet.code(3, 5) "0305" iex> set = Codemojex.EmojiSet.new("demo", 6, 6, cell_size: 144) iex> Codemojex.EmojiSet.bg_position(set, "0305") {-432, -720} iex> length(Codemojex.EmojiSet.all_cells(6, 6)) 36
The two seeded sheets
seeds.exsThe EMS set carries the sprite grid (cols, rows, cell_size, sprite_url) and the exposed codes — the full keyboard. The sheet is addressed by a plain sprite_url asset path, not a branded id. Two sets are seeded, each measured from the real PNG at cell size 72.
# grids measured from the PNGs under docs/codemojex/emoji-sets/ EmojiSet.new("emoji-set-01", 10, 15, cell_size: 72, sprite_url: "/emoji-sets/01-emoji-set.png") # 720×1080 → 150 cells EmojiSet.new("emoji-set-02", 10, 21, cell_size: 72, sprite_url: "/emoji-sets/02-emoji-set.png") # 720×1512 → 210 cells
The reduced golden subset
rooms.exA classic game snapshots the full keyboard. A golden game can shrink it: when the room sets cell_count: N, snapshot_cells/2 draws a fresh randomized N-cell subset, and the six-code secret is drawn only from that snapshot.
The player-facing snapshot/1 carries only the keyboard — codes, sprite_url, cell_size, cols, rows, count — and nothing the secret could be derived from.
References
sources · relatedSources
- Mastermind — the board gamethe symbol set and code space the keyboard defines
- Commitment schemes — commit and revealwhy the reduced golden space stays blind
Related
- C2 — Rooms, Modes, and the Secretthe chapter hub
- C2.3 — The secret and its commitmentthe secret drawn from this keyboard
- C1 — The Game as Branded Systemsthe EMS key and the privacy of the snapshot