Skip to content

Commit

Permalink
use struct field rather than global var
Browse files Browse the repository at this point in the history
  • Loading branch information
mdb committed Feb 8, 2022
1 parent c3a4f64 commit e32539d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = 0.0.3
VERSION = 0.0.4
SOURCE = ./...

.DEFAULT_GOAL := build
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (w *wordle) run() {
w.write(fmt.Sprintf("Guess a %v-letter word within %v guesses...\n", w.wordLength, w.maxGuesses))

for guessCount := 0; guessCount < w.maxGuesses; guessCount++ {
w.write(fmt.Sprintf("\nGuess (%v/%v): ", len(w.guesses)+1, maxGuesses))
w.write(fmt.Sprintf("\nGuess (%v/%v): ", len(w.guesses)+1, w.maxGuesses))

reader.Scan()
guess := strings.ToUpper(reader.Text())
Expand All @@ -144,7 +144,7 @@ func (w *wordle) run() {
break
}

if guessCount == maxGuesses-1 {
if guessCount == w.maxGuesses-1 {
fmt.Println()
w.displayRow(w.word, w.getLetterTileColors(w.word))
os.Exit(1)
Expand Down

0 comments on commit e32539d

Please sign in to comment.