bugfix on iterating to previous position
This commit is contained in:
parent
02f6a3256c
commit
580f8bf8ee
@ -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) {
|
static uint8_t get_prev_pos(uint8_t curr_pos, WordleLetterResult *word_elements_result) {
|
||||||
if (curr_pos == 0) return 0;
|
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)
|
if (word_elements_result[pos] != WORDLE_LETTER_CORRECT)
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user