From 419f0ae3cfa29fda4db76785c5bffb5f8e8e75e5 Mon Sep 17 00:00:00 2001 From: Caleb Denio Date: Thu, 1 Oct 2026 10:40:54 -0600 Subject: [PATCH] handle empty copyright --- game/game.go | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/game/game.go b/game/game.go index f923f28..28b3a5e 100644 --- a/game/game.go +++ b/game/game.go @@ -341,22 +341,24 @@ func (state *State) RenderUI(w io.Writer, width int) int { io.WriteString(w, "\r\n") uiHeight += 1 } - fmt.Fprintf(w, "%s\r\n", state.Puzzle.Copyright) - uiHeight += 1 + if state.Puzzle.Copyright != "" { + fmt.Fprintf(w, "%s\r\n\r\n", state.Puzzle.Copyright) + uiHeight += 2 + } switch state.UIState { case StateGame: - fmt.Fprintln(w, AnsiDimmed("\r\n[enter]/[tab]: next word | [ctrl+a]: menu | [ctrl+c]: exit")) - uiHeight += 2 + fmt.Fprintln(w, AnsiDimmed("[enter]/[tab]: next word | [ctrl+a]: menu | [ctrl+c]: exit")) + uiHeight += 1 case StateMenu: - fmt.Fprintln(w, AnsiDimmed("\r\n[c]: check puzzle/word | [r]: reveal puzzle/word | [x]: clear grid | [q]: exit menu")) - uiHeight += 2 + fmt.Fprintln(w, AnsiDimmed("[c]: check puzzle/word | [r]: reveal puzzle/word | [x]: clear grid | [q]: exit menu")) + uiHeight += 1 case StateCheckMenu: - fmt.Fprintln(w, AnsiDimmed("\r\n[w]: check word | [p]: check puzzle | [q]: exit menu")) - uiHeight += 2 + fmt.Fprintln(w, AnsiDimmed("[w]: check word | [p]: check puzzle | [q]: exit menu")) + uiHeight += 1 case StateRevealMenu: - fmt.Fprintln(w, AnsiDimmed("\r\n[w]: reveal word | [p]: reveal puzzle | [q]: exit menu")) - uiHeight += 2 + fmt.Fprintln(w, AnsiDimmed("[w]: reveal word | [p]: reveal puzzle | [q]: exit menu")) + uiHeight += 1 } switch state.SolveState {