From 9666676766bf21364f4fc4d0d1d336e72f2a91b4 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Tue, 6 Oct 2026 12:57:23 -0400 Subject: refactor: split casino.go, dedup helpers, remove audit docs --- internal/casino/plinko.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'internal/casino/plinko.go') diff --git a/internal/casino/plinko.go b/internal/casino/plinko.go index 867978a..bcfae83 100644 --- a/internal/casino/plinko.go +++ b/internal/casino/plinko.go @@ -29,6 +29,12 @@ func validatePlinko(c TableConfig) error { if math.IsNaN(r) || math.IsInf(r, 0) || r < 31 || r > 100 { return fmt.Errorf("plinko rtp must be between 31 and 100 percent") } + // The one-decimal paytable rounding can push the realized expert return + // above 100%. Reject any target whose expert paytable pays more than it + // takes, so the house never runs a losing plinko board. + if ret := plinkoReturn(3, r); ret > 1.0 { + return fmt.Errorf("plinko rtp %.1f makes the expert paytable return %.3f%%; lower it", r, 100*ret) + } if c.MaxPlayers > 1 { return fmt.Errorf("plinko has one seat") } -- cgit v1.2.3