Skip to content

Commit

Permalink
Improved output.
Browse files Browse the repository at this point in the history
Not logging the grid each turn in auto mode
Showing answer on failure.
  • Loading branch information
archy-bold committed Jan 5, 2022
1 parent 4943681 commit 016f27a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,16 @@ func main() {
strat.SetMoveOutcome(g.GetLastPlay())
}

fmt.Println(g.OutputForConsole())
if strat == nil || success || g.HasEnded() {
fmt.Println(g.OutputForConsole())
}

if success {
score, of := g.GetScore()
fmt.Printf("Great work! %d/%d\n", score, of)
return
} else if g.HasEnded() {
fmt.Printf("Better luck next time! X/%d\n", NUM_ATTEMPTS)
fmt.Printf("Better luck next time! The word was '%s'. X/%d\n", answer, NUM_ATTEMPTS)
return
}
}
Expand Down

0 comments on commit 016f27a

Please sign in to comment.