commit d0b08002961ba6d30a87003747cbc56f70161908
parent 54b8cd8fce22623c4063c3ac7df092825f99aa22
Author: aabacchus <ben@bvnf.space>
Date: Tue, 28 Sep 2021 11:59:26 +0100
__TEST_VERBOSE
Diffstat:
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/cgol.h b/cgol.h
@@ -32,7 +32,7 @@ struct imgdata {
int alive(int x, int y, short *cells, int nx, int ny);
int evolve(short *cells, int nx, int ny);
int neighbours(int x, int y, short *cells, int nx, int ny);
-#ifdef __TEST
+#ifdef __TEST_VERBOSE
int verbose_neighbours(int x, int y, short *cells, int nx, int ny);
#endif
/* cells[i][j] should match i = img->ny, j = img->nx */
diff --git a/rules.c b/rules.c
@@ -12,7 +12,7 @@ evolve(short *cells, int nx, int ny) {
for (j = 0; j < nx; j++) {
int n = neighbours(j, i, cells, nx, ny);
int isalive = alive(j, i, cells, nx, ny);
-#ifdef __TEST
+#ifdef __TEST_VERBOSE
if (n) {
printf("%d,%d is %d and has %d neighbours\n", j, i, isalive, n);
verbose_neighbours(j, i, cells, nx, ny);
@@ -73,6 +73,7 @@ neighbours(int x, int y, short *cells, int nx, int ny) {
return n;
}
+#ifdef __TEST_VERBOSE
int
verbose_neighbours(int x, int y, short *cells, int nx, int ny) {
int n = 0;
@@ -100,3 +101,4 @@ verbose_neighbours(int x, int y, short *cells, int nx, int ny) {
return n;
}
+#endif