From 61fb8e950e0b30ef0ee65aa5882545e5292d9112 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Tue, 29 Sep 2026 14:35:57 -0400 Subject: fix: roulette table box drawing characters --- internal/casino/roulette.go | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) (limited to 'internal/casino/roulette.go') 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.")} -- cgit v1.2.3