diff options
| author | historia <[not public]> | 2026-10-06 12:57:23 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-06 12:57:23 -0400 |
| commit | 9666676766bf21364f4fc4d0d1d336e72f2a91b4 (patch) | |
| tree | 0cade34091d7602790dc38cd44053f0b74bbadf2 /internal/casino/plinko.go | |
| parent | 4bc1daaf259e0c19c5fe4a12ec8bc7f6e5a735c1 (diff) | |
| download | thehouseoficarus-9666676766bf21364f4fc4d0d1d336e72f2a91b4.tar.gz | |
refactor: split casino.go, dedup helpers, remove audit docs
Diffstat (limited to 'internal/casino/plinko.go')
| -rw-r--r-- | internal/casino/plinko.go | 6 |
1 files changed, 6 insertions, 0 deletions
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") } |
