Files
digital-me-history/digital-me-backend/scripts/census-zelu-cost.mjs
T
admin 0593ff7e62
nginx serve /uploads direct (audio speed) / patch-nginx (push) Failing after 1m34s
数字我 Digital Me:全量入库(大文件走 Git LFS)
2026-10-10 16:24:43 +08:00

40 lines
2.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// ★ 第八刀的代价读数:【放宽到老板的判据之后,有多少人会被多问一句「你走哪条」】
// 老板上一刀要的那个数逐字:「⚠ 而必须先说清代价:实测汉有 169,984 个 profile(32.4%)
// 至少有一条输在 _idx 的路 —— 即三个汉朝用户里有一个会被多问一句。」⇒ 现在这个数变了。
import { DYNASTIES, computeRank, computeAxes } from '../src/dynasties.js';
import { SUB_REGISTRY } from '../src/talents.js';
const SUBS = SUB_REGISTRY.map((s) => s.id);
const WANGS = [0, 29, 30, 54, 55, 74, 75, 100];
const TOT = (1 << 16) * WANGS.length;
const P = {};
for (const d of DYNASTIES) P[d.id] = { name: d.name, ask: 0, n2: 0, n3: 0, idxOnly: 0, hasLex: 0, noRoad: 0 };
for (let m = 0; m < (1 << 16); m++) {
const subs = []; for (let i = 0; i < 16; i++) if (m & (1 << i)) subs.push(SUBS[i]);
const axes = computeAxes(subs);
for (const wang of WANGS) for (const d of DYNASTIES) {
const r = computeRank({ axes, wang }, d.id);
const s = P[d.id];
if (!r.channel) { s.noRoad++; continue; }
const tie = r.zelu.tie || [];
if (tie.length <= 1) continue;
s.ask++;
if (tie.length === 2) s.n2++; else s.n3++;
const kinds = tie.filter((t) => !t.isDefault).map((t) => t.lostAt);
if (kinds.every((k) => k === 'idx')) s.idxOnly++;
if (kinds.includes('lex')) s.hasLex++;
}
}
const N = (n) => n.toLocaleString();
const pad = (s, n) => String(s).padEnd(n), num = (s, n) => String(s).padStart(n);
console.log(`\n══ 【放宽后:有多少人会被多问一句「你走哪条」】每朝 ${N(TOT)} 个 profile ══\n`);
console.log(pad('朝', 8) + num('要问', 10) + num('占比', 8) + num('2 选 1', 9) + num('≥3 选', 8) +
num('★ 只含 idx', 12) + num('★ 含 lex', 10) + num('一条路都不开', 13));
console.log('─'.repeat(80));
let A = 0;
for (const d of DYNASTIES) {
const s = P[d.id]; A += s.ask;
console.log(pad(s.name, 8) + num(N(s.ask), 10) + num((s.ask / TOT * 100).toFixed(1) + '%', 8) +
num(N(s.n2), 9) + num(N(s.n3), 8) + num(N(s.idxOnly), 12) + num(N(s.hasLex), 10) + num(N(s.noRoad), 13));
}
console.log(`\n【总计】${N(TOT * DYNASTIES.length)} 格中 ${N(A)} 格(${(A / (TOT * DYNASTIES.length) * 100).toFixed(1)}%)会被多问一句。`);