From 4f40f116ba884111c9a66849e620ff9fbc67530a Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 2 Oct 2026 14:43:26 -0400 Subject: feat: compact craps layout, ux cleanup --- internal/game/render_craps_test.go | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'internal/game/render_craps_test.go') diff --git a/internal/game/render_craps_test.go b/internal/game/render_craps_test.go index 9d75630..b3cc1d8 100644 --- a/internal/game/render_craps_test.go +++ b/internal/game/render_craps_test.go @@ -45,7 +45,7 @@ func TestCrapsHalfTableGeometryAndPuck(t *testing.T) { if strings.Count(art, want) != 1 { t.Fatalf("missing/duplicate puck %d: %s", point, art) } - if !strings.Contains(art, "12 PAYS 3:1") { + if !strings.Contains(art, "12 PAYS TRIPLE") { t.Fatal("field variant invisible") } for _, bet := range []string{"DON'T COME", "C O M E", "FIELD", "DON'T PASS", "PASS LINE", "HARD 4", "HARD 6", "HARD 8", "HARD 10", "SEVEN", "CRAPS", "ELEVEN", "ACES", "ACE 3", "BOXCARS", "HORN", "HOP"} { @@ -58,7 +58,7 @@ func TestCrapsHalfTableGeometryAndPuck(t *testing.T) { t.Log("\n" + renderCrapsSnapshot(&casino.CrapsSnapshot{Point: 6, Field12: 3, Dice: [2]int{3, 3}, Queue: []string{"Alice", "Bob"}, Made: []int{4, 5}, Seen: []int{2, 4, 5, 6, 9}, Phase: "betting", ShootIn: 10, DealerIn: 70}, "none", true)) } func TestCrapsTrackersAndDiceStyles(t *testing.T) { - s := &casino.CrapsSnapshot{Made: []int{4, 6}, Seen: []int{2, 12}} + s := &casino.CrapsSnapshot{Point: 6, Made: []int{4, 6}, Seen: []int{2, 12}} art := renderCrapsTrackers(s, "xterm256", true) plain := plainRoulette(art) for _, token := range []string{"[ 4*]", "[ 5 ]", "[ 6*]", " 2*", "12*"} { @@ -69,6 +69,9 @@ func TestCrapsTrackersAndDiceStyles(t *testing.T) { if strings.Count(art, color.BgCode("xterm256", 220)) != 4 { t.Fatal("wrong number of filled tracker tokens") } + if !strings.Contains(art, color.BgCode("xterm256", 124)) || !strings.Contains(art, color.BgCode("xterm256", 24)) { + t.Fatal("fire/ATS tracker backgrounds are not red/blue") + } if !strings.Contains(renderCrapsFelt(s, "xterm256", true), color.BgCode("xterm256", 22)) { t.Fatal("felt not dark green") } @@ -80,16 +83,16 @@ func TestCrapsTrackersAndDiceStyles(t *testing.T) { light := g.renderCasinoSnapshot(sess, s) p.Options["card_style"] = "dark" dark := g.renderCasinoSnapshot(sess, s) - if light == dark { - t.Fatal("card_style not wired to craps") + if light != dark { + t.Fatal("craps dice are intentionally style-independent") } for a := 1; a <= 6; a++ { for b := 1; b <= 6; b++ { for _, unicode := range []bool{false, true} { - lit := renderCrapsDice([2]int{a, b}, "xterm256", unicode, "light") - dim := renderCrapsDice([2]int{a, b}, "xterm256", unicode, "dark") - if !strings.Contains(lit, color.BgCode("xterm256", 15)) || !strings.Contains(dim, color.BgCode("xterm256", 0)) { - t.Fatal("incorrect dice background") + lit := renderCrapsDice([2]int{a, b}, "xterm256", unicode) + dim := renderCrapsDice([2]int{a, b}, "xterm256", unicode) + if !strings.Contains(lit, color.BgCode("xterm256", 15)) || !strings.Contains(dim, color.BgCode("xterm256", 15)) { + t.Fatal("craps dice should always use a white background") } pip := "o" if unicode { -- cgit v1.2.3