summaryrefslogtreecommitdiff
path: root/Advent-of-Code-2021/AOC-16
diff options
context:
space:
mode:
authorkartofen <mladenovnasko0@gmail.com>2022-08-01 23:44:04 +0300
committerkartofen <mladenovnasko0@gmail.com>2022-08-01 23:44:04 +0300
commit4e9132b983c771d3e70d5a6b8bcdfdb1fead81fa (patch)
tree9f5e195a6c8600f065a057004670c00cfa5abee1 /Advent-of-Code-2021/AOC-16
parent1d96c68c66ba5648d1dd4d8ff2976fc97eea8a14 (diff)
some more
Diffstat (limited to 'Advent-of-Code-2021/AOC-16')
-rwxr-xr-xAdvent-of-Code-2021/AOC-16/build.sh7
-rw-r--r--Advent-of-Code-2021/AOC-16/main.c25
2 files changed, 32 insertions, 0 deletions
diff --git a/Advent-of-Code-2021/AOC-16/build.sh b/Advent-of-Code-2021/AOC-16/build.sh
new file mode 100755
index 0000000..6be9241
--- /dev/null
+++ b/Advent-of-Code-2021/AOC-16/build.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -xe
+
+gcc -o main -Wall -Wextra main.c
+
+./main
diff --git a/Advent-of-Code-2021/AOC-16/main.c b/Advent-of-Code-2021/AOC-16/main.c
new file mode 100644
index 0000000..baa6501
--- /dev/null
+++ b/Advent-of-Code-2021/AOC-16/main.c
@@ -0,0 +1,25 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+#if 1
+ #define FILE_PATH "example.txt"
+#else
+ #define FILE_PATH "input.txt"
+#endif
+
+void parse()
+{
+ FILE *fp = fopen(FILE_PATH, "r");
+ if(!fp) {
+ fprintf(stderr, "ERROR: Could not open file: %s\n", FILE_PATH);
+ exit(EXIT_FAILURE);
+ }
+
+ fclose(fp);
+}
+
+int main(void)
+{
+ parse();
+ return 0;
+}