MCPcopy Create free account
hub / github.com/AxlLind/AdventOfCode / build_list

Function build_list

2020/src/bin/23.c:11–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9typedef struct Node { struct Node *next; } Node;
10
11Node* build_list(int size) {
12 Node *list = malloc(sizeof(Node) * size);
13 Node *curr = list + INPUT[0];
14 for (int i = 1; i < size; curr = curr->next, ++i)
15 curr->next = list + (i < 9 ? INPUT[i] : i + 1);
16 curr->next = list + INPUT[0];
17 return list;
18}
19
20Node* simulate_game(int size, int rounds) {
21 Node *list = build_list(size);

Callers 1

simulate_gameFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected