Skip to content
Snippets Groups Projects

Fix #3: trim the puzzle guess and the solution before comparing them

Merged Fix #3: trim the puzzle guess and the solution before comparing them
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
@@ -67,7 +67,7 @@ public class PuzzleAttemptService {
guessObject = guessRepository.save(guessObject);
attempt.getGuesses().add(guessObject);
if (attempt.getPuzzle().getSolution().toLowerCase().equals(guess.toLowerCase())) {
if (attempt.getPuzzle().getSolution().trim().equalsIgnoreCase(guess.trim())) {
attempt.setSolved(true);
}
puzzleAttemptRepository.save(attempt);
Loading