feat: auto cash-out targets, 1% house edge, terminal aesthetic

Auto cash-out closes a position at exactly the chosen target rather than
the next tick's multiplier, and fires whenever the target is at or below
the crash point. This is the feature that makes the game playable over a
network, where manual timing is at the mercy of latency.

House edge drops from 2% to 1% across crash and scratch. Scratch prize
tables retuned so the published 99% RTP is exact.

Adds docs/API.md: the client uses no private endpoints, so anyone can
write a bot against the same API.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
drjones
2026-08-05 16:24:31 +00:00
parent dee3becd47
commit 48a9120fe4
14 changed files with 997 additions and 266 deletions

View File

@@ -41,8 +41,8 @@ func TestHouseEdgeAtTwoX(t *testing.T) {
}
}
pct := float64(wins) * 100 / n
if pct < 47.5 || pct > 50.5 {
t.Fatalf("win rate at 2.00x = %.2f%%, want ~49%%", pct)
if pct < 48.5 || pct > 51.0 {
t.Fatalf("win rate at 2.00x = %.2f%%, want ~49.5%%", pct)
}
}
@@ -60,8 +60,8 @@ func TestExpectedReturnMatchesEdge(t *testing.T) {
}
}
rtp := returned * 100 / n
if rtp < 96.0 || rtp > 100.0 {
t.Fatalf("RTP at %dx = %.2f%%, want ~98%%", targetX, rtp)
if rtp < 97.0 || rtp > 101.0 {
t.Fatalf("RTP at %dx = %.2f%%, want ~99%%", targetX, rtp)
}
}
}