You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
elseif (!overlayBG && !alive) SEGMENT.setPixelColorXY(x,y, color); // Redraw dead cells for default overlayFG
5252
+
}
5253
+
5255
5254
if (SEGENV.step > strip.now || strip.now - SEGENV.step < 1000 / (uint32_t)map(SEGMENT.speed,0,255,1,64)) return FRAMETIME; //skip if not enough time has passed (1-64 updates/sec)
5256
5255
5257
5256
//Update Game of Life
@@ -5266,14 +5265,14 @@ uint16_t mode_2Dgameoflife(void) { // Written by Ewoud Wijma, inspired by https:
5266
5265
CRGB nColors[3]; // track 3 colors, dying cells may overwrite but this wont be used
5267
5266
5268
5267
for (int i = -1; i <= 1; i++) for (int j = -1; j <= 1; j++) { // iterate through 3*3 matrix
5269
-
if (i==0 && j==0) continue; // ignore itself
5268
+
if (i == 0 && j == 0) continue; // ignore itself
5270
5269
if (!wrap || generation % 1500 == 0) { //no wrap, disable wrap every 1500 generations to prevent undetected repeats
5271
-
cX = x+i;
5272
-
cY = y+j;
5270
+
cX = x + i;
5271
+
cY = y + j;
5273
5272
if (cX < 0 || cY < 0 || cX >= cols || cY >= rows) continue; //skip if out of bounds
5274
5273
} else { //wrap around
5275
-
cX = (x+i+cols) % cols;
5276
-
cY = (y+j+rows) % rows;
5274
+
cX = (x + i + cols) % cols;
5275
+
cY = (y + j + rows) % rows;
5277
5276
}
5278
5277
cIndex = cY * cols + cX; //neighbor cell index
5279
5278
// count neighbors and store upto 3 neighbor colors
@@ -5341,7 +5340,7 @@ uint16_t mode_2Dgameoflife(void) { // Written by Ewoud Wijma, inspired by https:
0 commit comments