aboutsummaryrefslogtreecommitdiff
path: root/internal/game/render_craps_cards.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-30 16:16:17 -0400
committerhistoria <[not public]>2026-09-30 16:16:17 -0400
commita4c09c2d38d1f3bc1d3ad4bdb0234bdea7c37e73 (patch)
tree00c9567e620f331a59dd44f1f1fa779ecd94a845 /internal/game/render_craps_cards.go
parent724079f8de1ae69965c6267dca3d7fc3cc86afa2 (diff)
downloadthehouseoficarus-a4c09c2d38d1f3bc1d3ad4bdb0234bdea7c37e73.tar.gz
feat: additional craps variants added, standardizard casino command hints
Diffstat (limited to 'internal/game/render_craps_cards.go')
-rw-r--r--internal/game/render_craps_cards.go44
1 files changed, 44 insertions, 0 deletions
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()
+}