1 in 1.4 Billion (14亿分之1)
A browser game in Chinese. You're born somewhere in China and live one life, month by month, on UN, WHO and yearbook statistics. Every run can be replayed exactly.
TypeScript · React · Vite · Vitest · Python

Most life sims make up their odds. I wanted one where they come from data: which province you’re born in, whether you survive childhood, what you earn, what a flat costs. The simulation engine has no UI dependencies and runs the same in Node as in the browser.
- Real tables, checked rather than fitted. A Python script turns sourced data (UN life tables, WHO causes of death, the national yearbook, 27 provinces’ gaokao rank tables) into a generated TypeScript module. Over 40,000 simulated lives, life expectancy comes out at 75.3 / 81.0 against the UN’s 75.25 / 80.97.
- Bit-for-bit determinism. The RNG state lives in the save file, and
exp,log,poware a plain-JS fdlibm port, because browsers can differ in the last bit. Flavor text draws from a separate stream, so editing content never changes how a life turns out. - Golden snapshots and replay. A test hashes 220 fixed-seed lives; any rule change that alters one fails until the snapshot is regenerated on purpose. A run ID is enough to replay a bug report.
- Every number shows its math. The small “i” opens the formula, this person’s values, and the source.

Where data is missing, such as some salaries and county house prices, values are estimates and labeled as such.