bugfix on iterating to previous position

This commit is contained in:
David Volovskiy 2024-08-17 06:33:14 -04:00
parent 02f6a3256c
commit 580f8bf8ee

View file

@ -98,7 +98,7 @@ static uint8_t get_next_pos(uint8_t curr_pos, WordleLetterResult *word_elements_
static uint8_t get_prev_pos(uint8_t curr_pos, WordleLetterResult *word_elements_result) {
if (curr_pos == 0) return 0;
for (size_t pos = curr_pos-1; pos > 0; pos--) {
for (int8_t pos = curr_pos-1; pos >= 0; pos--) {
if (word_elements_result[pos] != WORDLE_LETTER_CORRECT)
return pos;
}