Fix life
This commit is contained in:
parent
31a3ee213e
commit
2238618881
|
|
@ -4,5 +4,3 @@
|
||||||
#define EXPORT(name) __attribute__((export_name(#name)))
|
#define EXPORT(name) __attribute__((export_name(#name)))
|
||||||
|
|
||||||
IMPORT(log) int console_log(const char* format, ...);
|
IMPORT(log) int console_log(const char* format, ...);
|
||||||
|
|
||||||
EXPORT(__srand) void srand(long long seed);
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
#include <js.h>
|
||||||
#include <graphics.h>
|
#include <graphics.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
@ -16,7 +17,7 @@ EXPORT(step) void step(void) {
|
||||||
for (int x = 0; x < WIDTH; x++) {
|
for (int x = 0; x < WIDTH; x++) {
|
||||||
int count = count_neighbours(x, y);
|
int count = count_neighbours(x, y);
|
||||||
uint8_t current_cell = field[x + y * WIDTH];
|
uint8_t current_cell = field[x + y * WIDTH];
|
||||||
int next_cell = current_cell;
|
uint8_t next_cell = current_cell;
|
||||||
if (current_cell && count < 2) {
|
if (current_cell && count < 2) {
|
||||||
next_cell = 0;
|
next_cell = 0;
|
||||||
} else if (current_cell && count > 3) {
|
} else if (current_cell && count > 3) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue