From a4c09c2d38d1f3bc1d3ad4bdb0234bdea7c37e73 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Wed, 30 Sep 2026 16:16:17 -0400 Subject: feat: additional craps variants added, standardizard casino command hints --- internal/game/render_craps_cards.go | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 internal/game/render_craps_cards.go (limited to 'internal/game/render_craps_cards.go') diff --git a/internal/game/render_craps_cards.go b/internal/game/render_craps_cards.go new file mode 100644 index 0000000..343f16f --- /dev/null +++ b/internal/game/render_craps_cards.go @@ -0,0 +1,44 @@ +package game + +import ( + "fmt" + "strings" + "thehouseoficarus/internal/color" +) + +// The two packs have ranks 1-6, no suits. Distinct pack labels make the +// replacement model visible without suggesting a conventional poker shoe. +func renderCrapsCards(cards [2]int, mode string, unicode bool, style string) string { + if cards[0] < 1 || cards[0] > 6 || cards[1] < 1 || cards[1] > 6 { + return "" + } + top, bottom, bar := "+-------+", "+-------+", "|" + if unicode { + top, bottom, bar = "╭───────╮", "╰───────╯", "│" + } + spec := color.ColorSpec{Fg: 15, Bg: 0, Bold: true} + if style == "light" { + spec = color.ColorSpec{Fg: 0, Bg: 15, Bold: true} + } + var out strings.Builder + for row := 0; row < 5; row++ { + out.WriteString(" ") + for i, n := range cards { + line := top + switch row { + case 1: + line = fmt.Sprintf("%s PACK %c%s", bar, 'A'+i, bar) + case 2: + line = fmt.Sprintf("%s %d %s", bar, n, bar) + case 3: + line = bar + " " + bar + case 4: + line = bottom + } + out.WriteString(color.Render(mode, spec, line) + " ") + } + out.WriteByte('\n') + } + fmt.Fprintf(&out, " Cards total: %d | Both packs replaced and reshuffled each draw.\n", cards[0]+cards[1]) + return out.String() +} -- cgit v1.2.3