diff options
| author | historia <[not public]> | 2026-10-05 20:00:02 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-05 20:00:02 -0400 |
| commit | 4bc1daaf259e0c19c5fe4a12ec8bc7f6e5a735c1 (patch) | |
| tree | f7ea1da2f88f37c44b937aaaf1fd12c722811147 /internal/game/casino_house_edge.go | |
| parent | a5447965e7808d656a5e5d9326a9ca0231148f85 (diff) | |
| download | thehouseoficarus-4bc1daaf259e0c19c5fe4a12ec8bc7f6e5a735c1.tar.gz | |
feat: terminal talk action, typed pai gow poker phase
Diffstat (limited to 'internal/game/casino_house_edge.go')
| -rw-r--r-- | internal/game/casino_house_edge.go | 16 |
1 files changed, 3 insertions, 13 deletions
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...) |
