fix reproduction in game of life

A typo caused broken counting of the most common color in neighbouring
cells and blocked reproduction in some directions.
This commit is contained in:
Miroslav Lichvar 2025-01-21 19:58:37 +01:00
parent 2448266d7c
commit 39512da74e

View File

@ -5137,7 +5137,7 @@ uint16_t mode_2Dgameoflife(void) { // Written by Ewoud Wijma, inspired by https:
neighbors++;
bool colorFound = false;
int k;
for (k=0; k<9 && colorsCount[i].count != 0; k++)
for (k=0; k<9 && colorsCount[k].count != 0; k++)
if (colorsCount[k].color == prevLeds[xy]) {
colorsCount[k].count++;
colorFound = true;