aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/roulette.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-29 14:35:57 -0400
committerhistoria <[not public]>2026-09-29 14:35:57 -0400
commit61fb8e950e0b30ef0ee65aa5882545e5292d9112 (patch)
tree06319b38231d1b86236b8d3944a1accf9824eb08 /internal/casino/roulette.go
parent004dcd3826856870b267a55dacf84aa7742b7e3f (diff)
downloadthehouseoficarus-61fb8e950e0b30ef0ee65aa5882545e5292d9112.tar.gz
fix: roulette table box drawing characters
Diffstat (limited to 'internal/casino/roulette.go')
-rw-r--r--internal/casino/roulette.go39
1 files changed, 31 insertions, 8 deletions
diff --git a/internal/casino/roulette.go b/internal/casino/roulette.go
index ed649e9..5784ac9 100644
--- a/internal/casino/roulette.go
+++ b/internal/casino/roulette.go
@@ -34,9 +34,31 @@ func rouletteRed(n int) bool {
return false
}
+// normalizeRouletteSpot maps legacy bet names onto the labels shown on the
+// board. The old dozen/column spellings stay accepted so existing habits and
+// older help text keep working.
+func normalizeRouletteSpot(spot string) string {
+ switch spot {
+ case "dozen1":
+ return "1to12"
+ case "dozen2":
+ return "13to24"
+ case "dozen3":
+ return "25to36"
+ case "column1":
+ return "row1"
+ case "column2":
+ return "row2"
+ case "column3":
+ return "row3"
+ }
+ return spot
+}
+
// Returns the covered pockets and total-return multiplier (stake included).
// Zero never belongs to an outside bet.
func rouletteBet(spot string, double bool) ([]string, int) {
+ spot = normalizeRouletteSpot(spot)
if spot == "00" {
if double {
return []string{spot}, 36
@@ -62,18 +84,18 @@ func rouletteBet(spot string, double bool) ([]string, int) {
hit = n <= 18
case "high":
hit = n >= 19
- case "dozen1":
+ case "1to12":
hit = n <= 12
- case "dozen2":
+ case "13to24":
hit = n >= 13 && n <= 24
- case "dozen3":
+ case "25to36":
hit = n >= 25
- case "column1":
- hit = n%3 == 1
- case "column2":
- hit = n%3 == 2
- case "column3":
+ case "row1":
hit = n%3 == 0
+ case "row2":
+ hit = n%3 == 2
+ case "row3":
+ hit = n%3 == 1
}
if hit {
pockets = append(pockets, strconv.Itoa(n))
@@ -162,6 +184,7 @@ func (t *rouletteTable) bet(name, spot string, amount int, w Wallet) []Event {
if spot == "" {
spot = p.lastSpot
}
+ spot = normalizeRouletteSpot(spot)
_, mult := rouletteBet(spot, t.Config.Roulette.DoubleZero)
if mult == 0 {
return []Event{t.private(name, "Unknown roulette target. Use table to see all available bets.")}