Skip to content

v1.11.1: choose how core counts are written - #19

Merged
NeverEndingCode merged 2 commits into
mainfrom
core-number-format
Sep 1, 2026
Merged

v1.11.1: choose how core counts are written#19
NeverEndingCode merged 2 commits into
mainfrom
core-number-format

Conversation

@NeverEndingCode

Copy link
Copy Markdown
Owner

Legacy Cores were the last number in the game still printed in full — nineteen digits by the mid game, in a row sized for a phone, with a second one on the Migrate button beside it.

Profile → Settings now offers three renderings, and the header chip itself is a button that cycles them in place:

Format Header chip Migrate button
Full (default, unchanged) 4087353084334554000 cores +124626540980725780 cores
ABC 4.09F cores +125E cores
Sci 4.09e+18 cores +1.25e+17 cores

ABC is bijective base-26 — one letter per power of a thousand, A…Z then AA, AB — so unlike the fixed K/M/G ladder in fmt() it never runs out. Both compact modes stay literal below a thousand, because "50 cores" reads better than "5.00e+1 cores".

Applied to every core readout: the chip, the Migrate payout, the Singularity panel and its confirmation, Profile stats, and the Legacy Cores leaderboard. Default stays full, so an untouched save reads exactly as it did before.

The preference is client-side (localStorage), not canonical state — nothing in the simulation reads it, so there's no migration and no server round trip. It lives in a module-level useSyncExternalStore so the chip, Migrate button, Singularity panel and Settings picker all move together when the chip is tapped.

Versioning: patch, not minor — v1.12.0 is claimed by #18.

Verification

  • tests/coreFormat.test.js — 13 new tests: the three formats, the A→Z→AA rollover, negatives/∞, cycling, normalization of unrecognized input.
  • Full SQLite suite: 2261 passing across 147 files, no failures.
  • client && npm run build clean.
  • The three formats were rendered through the real StatsRow, MigrateBar and ProfileSettings via react-dom/server to confirm the strings in the table above.

🤖 Generated with Claude Code

Evan Phyillaier and others added 2 commits August 31, 2026 21:26
Legacy Cores were the last number still printed in full. By the mid game that
is nineteen digits in a row sized for a phone, and the Migrate button carries a
second one beside it - the two numbers a player looks at most often were the
two least readable in the game.

fmtCores(n, format) offers three renderings. 'full' is the historical one and
stays the default, so an untouched save reads exactly as it did before the
setting existed. 'letters' walks A..Z then AA, AB - bijective base-26, one
letter per power of a thousand, so it cannot run out the way the fixed K/M/G
ladder in fmt() does at 10^33. 'scientific' is toExponential(2), matching the
shape the Compute Balance readout already falls back to.

Both compact modes stay literal below a thousand: "50 cores" reads better than
"5.00e+1 cores", and there is nothing to abbreviate down there anyway.

The preference is client-side (localStorage), not canonical state - nothing in
the simulation reads it, so there is no migration and no server round trip. It
lives in a module-level useSyncExternalStore rather than component state
because the header chip, the Migrate button, the Singularity panel and the
Settings picker all render it and cycling from the chip has to move all of
them at once; the alternative was threading a prop through RackStack.jsx to
five places. Storage access is try/caught - a private-mode browser falls back
to the default instead of taking the header down with a SecurityError.

The header chip is now a button that cycles the setting in place, since the
number itself is what a player is looking at when they want it changed. The
same choice is in Profile > Settings for anyone who would rather pick it
explicitly, previewing against their own core count.

Applied to every core readout, not just the header: the chip, the Migrate
payout, the Singularity panel and its confirmation, Profile stats, and the
Legacy Cores leaderboard.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Patch rather than minor: v1.12.0 is already claimed by the open Economy
Rebalance PR (#18), and stealing the number would leave that branch with
nowhere to land.

package-lock.json's version field had been stale since v1.7.0 - `npm install`
resynced it to 1.11.1 as a side effect, and that correction rides along here
rather than as its own commit.

Verified: SQLite 2261 passing across 147 files, client builds, and the three
formats render as expected through StatsRow, MigrateBar and the Settings
picker.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@NeverEndingCode
NeverEndingCode merged commit 8f1fe55 into main Sep 1, 2026
4 checks passed
@NeverEndingCode
NeverEndingCode deleted the core-number-format branch September 1, 2026 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant