Skip to content

Commit

Permalink
add hitmap state update on correct guess
Browse files Browse the repository at this point in the history
  • Loading branch information
rccsousa committed Nov 7, 2024
1 parent 6fc814f commit 479947c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Wordle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ contract Wordle {
StructTypes.CharState[] memory guessHitmap = StringUtils.generateHitmap(guess);

if (StringUtils.areEqual(guess, HIDDEN_WORD)) {
for (uint256 i = 0; i < guessHitmap.length; i++) {
guessHitmap[i].state = 2;
}
GUESSES[player].push(guessHitmap);
emit CorrectGuess(guess, "Well done!");
return true;
}
Expand Down

0 comments on commit 479947c

Please sign in to comment.