diff options
| author | historia <[not public]> | 2026-09-30 05:47:11 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-30 05:47:11 -0400 |
| commit | 724079f8de1ae69965c6267dca3d7fc3cc86afa2 (patch) | |
| tree | 5de0420f6673c7823be122323db9a834afd1a151 /internal | |
| parent | 0fcb03633e3008169173d76c8408f5410592b3eb (diff) | |
| download | thehouseoficarus-724079f8de1ae69965c6267dca3d7fc3cc86afa2.tar.gz | |
feat: unicode dice on craps table
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/game/render_craps.go | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/internal/game/render_craps.go b/internal/game/render_craps.go index 19688ed..9f73b20 100644 --- a/internal/game/render_craps.go +++ b/internal/game/render_craps.go @@ -128,6 +128,13 @@ func crapsHas(ns []int, n int) bool { } return false } + +// Die-face glyph, e.g. ⚀ for one, used only where a felt paints dice pictures: +// the hardway pairs and horn combinations. Blobs come first so a die face +// never lexes as 1–6 elsewhere. +func crapsDie(n int) string { + return string([]rune{'⚀', '⚁', '⚂', '⚃', '⚄', '⚅'}[n-1]) +} func renderCrapsTrackers(s *casino.CrapsSnapshot, mode string, unicode bool) string { c := newCrapsCanvas(77, 7) c.box(0, 0, 76, 3) @@ -227,7 +234,11 @@ func renderCrapsFelt(s *casino.CrapsSnapshot, mode string, unicode bool) string if n == 6 || n == 8 { pay = 9 } - c.center(x+1, x+12, y+3, fmt.Sprintf("%d+%d %d:1", n/2, n/2, pay), crapsGold) + pair := fmt.Sprintf("%d+%d", n/2, n/2) + if unicode { + pair = crapsDie(n/2) + "+" + crapsDie(n/2) + } + c.center(x+1, x+12, y+3, fmt.Sprintf("%s %d:1", pair, pay), crapsGold) } props := []string{"SEVEN", "CRAPS", "ELEVEN", "ACES", "ACE 3", "BOXCARS"} odds := []string{"4:1", "7:1", "15:1", "30:1", "15:1", "30:1"} @@ -241,7 +252,12 @@ func renderCrapsFelt(s *casino.CrapsSnapshot, mode string, unicode bool) string } c.box(50, 21, 63, 25) c.center(51, 62, 22, "HORN", crapsGold) - c.center(51, 62, 24, "2 3 11 12", crapsMuted) + horn := "2 3 11 12" + if unicode { + // Horn combinations as painted dice pairs: 2, 3, 11, 12. + horn = strings.Join([]string{crapsDie(1) + crapsDie(1), crapsDie(1) + crapsDie(2), crapsDie(5) + crapsDie(6), crapsDie(6) + crapsDie(6)}, " ") + } + c.center(51, 62, 24, horn, crapsMuted) c.box(63, 21, 76, 25) c.center(64, 75, 22, "HOP", crapsGold) c.center(64, 75, 24, "15:1 / 30:1", crapsMuted) |
