1
0
Fork 0
This commit is contained in:
Pabloader 2025-09-11 13:08:35 +00:00
parent 31a3ee213e
commit 2238618881
2 changed files with 2 additions and 3 deletions

View File

@ -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);

View File

@ -1,3 +1,4 @@
#include <js.h>
#include <graphics.h>
#include <stdint.h>
#include <stdlib.h>
@ -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) {