From 2238618881e47421a3a889ae914f883fd25a5d4e Mon Sep 17 00:00:00 2001 From: Pabloader Date: Thu, 11 Sep 2025 13:08:35 +0000 Subject: [PATCH] Fix life --- build/assets/include/js.h | 2 -- src/games/life/life.c | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/build/assets/include/js.h b/build/assets/include/js.h index cbf9900..df40458 100644 --- a/build/assets/include/js.h +++ b/build/assets/include/js.h @@ -4,5 +4,3 @@ #define EXPORT(name) __attribute__((export_name(#name))) IMPORT(log) int console_log(const char* format, ...); - -EXPORT(__srand) void srand(long long seed); diff --git a/src/games/life/life.c b/src/games/life/life.c index 993855f..efb6097 100644 --- a/src/games/life/life.c +++ b/src/games/life/life.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -16,7 +17,7 @@ EXPORT(step) void step(void) { for (int x = 0; x < WIDTH; x++) { int count = count_neighbours(x, y); uint8_t current_cell = field[x + y * WIDTH]; - int next_cell = current_cell; + uint8_t next_cell = current_cell; if (current_cell && count < 2) { next_cell = 0; } else if (current_cell && count > 3) {