From 4bc1daaf259e0c19c5fe4a12ec8bc7f6e5a735c1 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Mon, 5 Oct 2026 20:00:02 -0400 Subject: feat: terminal talk action, typed pai gow poker phase --- internal/game/casino_house_edge.go | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'internal/game/casino_house_edge.go') diff --git a/internal/game/casino_house_edge.go b/internal/game/casino_house_edge.go index de0036b..ff3ce59 100644 --- a/internal/game/casino_house_edge.go +++ b/internal/game/casino_house_edge.go @@ -158,19 +158,9 @@ func (g *Game) showCasinoListTable(sess *net.Session, betHeader string, rows []c } } budget := max(len(headers), width-3*len(headers)-1) - for { - sum, widest := 0, 0 - for i, w := range widths { - sum += w - if w > widths[widest] { - widest = i - } - } - if sum <= budget || widths[widest] <= 1 { - break - } - widths[widest]-- - } + // Size the pre-wrapped cells with the same shrink algorithm Table.Render + // uses, instead of a second copy that can disagree on which column yields. + ui.FitWidths(widths, budget) table := ui.Table{} // Headers wrap too, so narrow terminals never lose a column label. all := append([][]string{headers}, cells...) -- cgit v1.2.3