summaryrefslogtreecommitdiff
path: root/2024/10/1.c
diff options
context:
space:
mode:
Diffstat (limited to '2024/10/1.c')
-rw-r--r--2024/10/1.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/2024/10/1.c b/2024/10/1.c
index e1aee04..315dd55 100644
--- a/2024/10/1.c
+++ b/2024/10/1.c
@@ -6,10 +6,7 @@
bool debug = true;
-
-
-
-
+/* This is the stuff of ideas.
typedef struct Stack {
void* value;
struct Stack* below;
@@ -28,12 +25,14 @@ push(Stack* s, void* value) {
t->below = s;
t->value = value;
return t;
-}
+} */
+// This global will die.
int score = 0;
void
travel(Graph2D* g, Coordinates c)
{
+ // Utility TBD
// g->visited[c.y][c.x] = true;
if (debug) {
@@ -52,7 +51,7 @@ travel(Graph2D* g, Coordinates c)
return;
}
for (int i = 0; i < DIRECTIONS; i++) {
- if (valid(g, cardinal[i])) {
+ if (graph_valid(g, cardinal[i])) {
if (debug) {
printf("%d,%d\n", cardinal[i].x, cardinal[i].y);
printf("%d\n", g->e[cardinal[i].y][cardinal[i].x]);
@@ -80,8 +79,10 @@ main()
exit(1);
}
- Graph2D* g = ingest(in);
+ Graph2D* g = graph_ingest(in);
+ /* Hash map from Coordinates of each starting point to their scores.
+ Pass to each travel, along with launch coordinates. */
hashmap* map = hashmap_create();
for (int i = 0; i < g->height; i++) {
for (int j = 0; j < g->width; j++) {
@@ -92,17 +93,6 @@ main()
}
}
}
-
- for (int i = 0; i < g->height; i++) {
- for (int j = 0; j < g->width; j++) {
- printf("%c", g->e[i][j]);
- }
- putchar('\n');
- free(g->e[i]);
- free(g->visited[i]);
- }
- free(g->e);
- free(g->visited);
- free(g);
+
return 0;
}