From 3ab9f195a304478750902e48ef587568b0891bf3 Mon Sep 17 00:00:00 2001 From: Jake Walker Date: Wed, 26 Jan 2022 10:27:55 +0000 Subject: [PATCH] fix: don't show word on replay --- main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 1570d31..b9e051a 100644 --- a/main.go +++ b/main.go @@ -145,8 +145,10 @@ func (m model) View() string { s += promptStyle.Render(footer) + "\n" } else { msg := "" - if m.board.CurrentGuess >= 6 { - msg += fmt.Sprintf("Oof! The word was %s.", m.board.Solution) + if m.board.CurrentGuess == -1 { + if m.board.Solution != "" { + msg += fmt.Sprintf("Oof! The word was %s.", m.board.Solution) + } } else { msg += fmt.Sprintf("Congrats! You guessed in %d.", m.board.CurrentGuess) }