From d3a305d1d7962f82af2397760cf8008758bddd1d Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 2 Oct 2026 01:54:37 -0400 Subject: feat: better 'list' bet table, multiple bets in baccarat --- internal/casino/house_edge_fire.go | 61 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 internal/casino/house_edge_fire.go (limited to 'internal/casino/house_edge_fire.go') diff --git a/internal/casino/house_edge_fire.go b/internal/casino/house_edge_fire.go new file mode 100644 index 0000000..3bb1697 --- /dev/null +++ b/internal/casino/house_edge_fire.go @@ -0,0 +1,61 @@ +package casino + +import "math/bits" + +// crapsFireReturn is the fire bet's exact expected return (profit plus stake +// where the bet wins; nothing where it loses) per unit staked. The bet +// resolves only on a point-phase seven-out — a come-out seven keeps the +// shooter's hand and the bet alive — paying 24/249/999:1 for 4/5/6 distinct +// made points. The state is the six-bit mask of distinct points made in the +// hand; come-out rolls and rerolls of an already-made point are self loops. +// Solved by fixed-point iteration over the 64 masks (the chain is absorbing +// and monotone, so iteration converges to the exact solution). +func crapsFireReturn() float64 { + numbers := []int{4, 5, 6, 8, 9, 10} + ways := make([]int, len(numbers)) + for i, n := range numbers { + ways[i] = diceWays(n) + } + pay := func(made int) float64 { + switch made { + case 4: + return 25 // 24:1 profit plus the returned stake + case 5: + return 250 + case 6: + return 1000 + } + return 0 + } + vCome := make([]float64, 64) + for it := 0; it < 2000; it++ { + next := make([]float64, 64) + for mask := 0; mask < 64; mask++ { + sum := 0.0 + for i := range numbers { + w := ways[i] + nm := mask | 1< 1e-12 || diff < -1e-12 { + done = false + break + } + } + vCome = next + if done { + break + } + } + return vCome[0] +} -- cgit v1.2.3