]> mj.ucw.cz Git - home-hw.git/commitdiff
neopixel-square: Yet more GoL patterns
authorMartin Mares <mj@ucw.cz>
Sun, 24 Mar 2024 16:28:05 +0000 (17:28 +0100)
committerMartin Mares <mj@ucw.cz>
Sun, 24 Mar 2024 16:28:05 +0000 (17:28 +0100)
test-neopixel-square/main.c

index 05f44b2e40f381878e5b3f139d604d9323472c4b..b1e80983606fddc4518e07fef3de108fb9cdff9b 100644 (file)
@@ -163,7 +163,7 @@ byte lpred[LN+2][LN+2];
 
 static void life_init(void)
 {
-#if 1
+#if 0
        // The R pentomino
        life[3][4] = 1;
        life[3][5] = 1;
@@ -182,6 +182,24 @@ static void life_init(void)
        life[2][3] = 1;
        life[3][2] = 1;
        life[3][3] = 1;
+#elif 1
+       // Octagon (period 5 oscillator)
+       life[1][4] = 1;
+       life[1][5] = 1;
+       life[2][3] = 1;
+       life[2][6] = 1;
+       life[3][2] = 1;
+       life[3][7] = 1;
+       life[4][1] = 1;
+       life[4][8] = 1;
+       life[5][1] = 1;
+       life[5][8] = 1;
+       life[6][2] = 1;
+       life[6][7] = 1;
+       life[7][3] = 1;
+       life[7][6] = 1;
+       life[8][4] = 1;
+       life[8][5] = 1;
 #endif
 }
 
@@ -247,7 +265,7 @@ int main(void)
                debug_led(0);
                // neopixel_set(NPIX_NUM_LEDS-1, 0, 0, 0x7f);
                delay_ms(500);
-               if (lsteps++ < 30)
+               if (lsteps++ < 3000)
                        life_step();
                else {
                        life_init();