diff options
-rw-r--r-- | 05-brain/src/main.c | 1 | ||||
-rw-r--r-- | 06-brain2/src/main.c | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/05-brain/src/main.c b/05-brain/src/main.c index dfa2d2c..bcd1660 100644 --- a/05-brain/src/main.c +++ b/05-brain/src/main.c @@ -76,6 +76,7 @@ int main(int argc, char **argv) reset: memset(bits1, 0, sizeof(bits1)); + memset(bits2, 0, sizeof(bits2)); while(true) { al_wait_for_event(eq, &e); diff --git a/06-brain2/src/main.c b/06-brain2/src/main.c index 5e1f387..4640638 100644 --- a/06-brain2/src/main.c +++ b/06-brain2/src/main.c @@ -76,6 +76,7 @@ int main(int argc, char **argv) reset: memset(bits1, 0, sizeof(bits1)); + memset(bits2, 0, sizeof(bits1)); while(true) { al_wait_for_event(eq, &e); @@ -86,7 +87,7 @@ reset: goto done; case ALLEGRO_EVENT_MOUSE_BUTTON_DOWN: - bits1[e.mouse.y / DISP_SCALE][e.mouse.x / DISP_SCALE] = 1; + bits1[e.mouse.y / DISP_SCALE][e.mouse.x / DISP_SCALE] = 3; mouse_down = true; break; @@ -107,6 +108,7 @@ reset: case ALLEGRO_KEY_2: memset(bits1, 0, sizeof(bits1)); + memset(bits2, 0, sizeof(bits2)); for (x = 0; x < SEED_BITS; x++) { bits1[randombytes_random() % BUF_H][randombytes_random() % BUF_W] = 3; } @@ -131,7 +133,7 @@ reset: if (mouse_down) { al_get_mouse_state(&ms); - bits1[ms.y / DISP_SCALE][ms.x / DISP_SCALE] = 1; + bits1[ms.y / DISP_SCALE][ms.x / DISP_SCALE] = 3; } /* step */ |