Cards: five-dimension look model, unified value function, higher prices

CardLook has five dimensions of three values each (fan, gold fingers,
bracket on the front; back print and back sticker on the back), 243
combinations. Wear traits follow health and appear on genuine cards too;
three signs (wrong port count, wrong or re-printed silkscreen, handwritten
serial) appear only on fakes, one to three of them. CardValue is the single
value function: sale price and the appraisal's correct value are both
price x (0.25 + 0.75 x health) of the chip actually inside; a dealer quotes
a fake by its labelled model. Graphics card prices rise to about 1.8x and
the block reward to 90 to keep the mining share in range.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ZHU MINCHAOandClaude Sonnet 5.5 committed 2026-11-03 11:20:33 +08:00
1 parent 6c48078e44
commit 4196151f7e
3 files changed
+121 -4

No files matched your search

@@ -128,6 +128,37 @@ internal static class Program
Check(r.Refurbish() && r.Health == 80 && !r.Refurbish(), "翻新一次 +30,不能再翻新");
});
Test("显卡外观:5 个维度 243 种;真卡没有破绽类取值,假卡至少一处;老化随健康度;价值函数统一", () =>
{
var rng = new Rng(99);
int n = 6000;
int fakeNoSign = 0, realSign = 0, newWorn = 0, oldWorn = 0, fakeSigns = 0;
var seen = new System.Collections.Generic.HashSet<string>();
for (int i = 0; i < n; i++)
{
var real = CardLook.Generate(rng, 100, false);
var oldReal = CardLook.Generate(rng, 30, false);
var fake = CardLook.Generate(rng, 60, true);
if (real.HasFakeSign || oldReal.HasFakeSign) realSign++;
if (!fake.HasFakeSign) fakeNoSign++;
fakeSigns += (fake.Bracket == 2 ? 1 : 0) + (fake.Print != 0 ? 1 : 0) + (fake.Sticker == 1 ? 1 : 0);
if (real.Fan > 0 || real.Fingers > 0) newWorn++;
if (oldReal.Fan > 0 || oldReal.Fingers > 0) oldWorn++;
seen.Add($"{fake.Fan}{fake.Fingers}{fake.Bracket}{fake.Print}{fake.Sticker}");
seen.Add($"{oldReal.Fan}{oldReal.Fingers}{oldReal.Bracket}{oldReal.Print}{oldReal.Sticker}");
}
Check(realSign == 0, "真卡从不出现破绽类取值(接口数不对、丝印不对、手写序列号)");
Check(fakeNoSign == 0, "假卡至少有一处破绽");
Check(Near(fakeSigns / (double)n, 1.65, 0.12), $"假卡平均 1.65 处破绽:{fakeSigns / (double)n:0.00}");
Check(oldWorn > newWorn * 1.8, $"低健康度的真卡明显更旧:{oldWorn / (double)n:P0} 对 {newWorn / (double)n:P0}");
Check(seen.Count >= 120, $"抽样见到 {seen.Count} 种不同组合(上限 243)");
Check(Hardware.Specs["RZX50"].Price == 220 && Hardware.Specs["RZX90"].Price == 5000 && Hardware.Specs["RZ7900"].Price == 4000, "价格已抬高到约 1.8 倍");
var u = new Unit { Model = "RZX90", FakeOf = "RZX60", Health = 80 };
Check(CardValue.True(u) == CardValue.Of("RZX60", 80) && CardValue.Quoted(u, 80) == CardValue.Of("RZX90", 80), "真实价值按芯片型号,标称价按标称型号");
Check(CardValue.Quoted(u, 80) > CardValue.True(u) * 8, $"假 RZX 90 的标称价 {CardValue.Quoted(u, 80)} 远高于真值 {CardValue.True(u)}");
Check(CardValue.Of("RZX70", 100) == 800 && CardValue.Of("RZX70", 0) == 200 && CardValue.Of("RZX70", 50) == 500, "健康 100 满价、0 剩 25%、50 为 62.5%");
});
Test("矿架槽位:默认 2 个,投入电子元件逐个升级到最多 5 个;只收下一级需要的;形状随槽数变化", () =>
{
int slots = RigSlots.Base, prog = 0;