This commit is contained in:
Richard
2026-03-26 18:43:01 +01:00
commit 9616a8236b
25 changed files with 2773 additions and 0 deletions

19
farm/ant.c Normal file
View File

@@ -0,0 +1,19 @@
#include "ant.h"
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
void reset_ants(struct Ant* ants, unsigned short nest) {
memset(ants, 0, sizeof(struct Ant) * NUM_ANTS);
for (int i = 0; i < NUM_ANTS; i++) {
ants[i].id = i;
ants[i].cell = nest;
}
}
struct Ant* create_ants() {
int ants_size = sizeof(struct Ant) * NUM_ANTS;
struct Ant *ants = (struct Ant *)malloc(ants_size);
return ants;
}