aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOrfeas <38209077+0xfea5@users.noreply.github.com>2023-12-06 03:27:00 +0200
committerOrfeas <38209077+0xfea5@users.noreply.github.com>2025-10-28 23:20:45 +0200
commit76ba3711e9a131dbc71bdfc8b0ab20186fb08087 (patch)
treedcfcf73dfeeb1a47d13dd10cb8e54ef2a4d00515
parentremoving inputs (diff)
downloadaoc23-76ba3711e9a131dbc71bdfc8b0ab20186fb08087.tar.gz
aoc23-76ba3711e9a131dbc71bdfc8b0ab20186fb08087.zip
create template file and update init script
-rw-r--r--day05/solution.zig23
-rwxr-xr-xinit.sh23
-rw-r--r--template.zig23
3 files changed, 47 insertions, 22 deletions
diff --git a/day05/solution.zig b/day05/solution.zig
new file mode 100644
index 0000000..059a120
--- /dev/null
+++ b/day05/solution.zig
@@ -0,0 +1,23 @@
1const std = @import("std");
2const print = std.debug.print;
3const assert = std.debug.assert;
4const ArrayList = std.ArrayList;
5const HashMap = std.HashMap;
6const mem = std.mem;
7
8const fin = mem.trim(u8, @embedFile("./input.txt"), &std.ascii.whitespace);
9var gpa = std.heap.GeneralPurposeAllocator(.{}){};
10const allocator = gpa.allocator();
11
12pub fn part1() void {
13 // Part 1 goes here
14}
15
16pub fn part2() void {
17 // Part 2 goes here
18}
19
20pub fn main() !void {
21 part1();
22 part2();
23}
diff --git a/init.sh b/init.sh
index fc34d8c..4e14cde 100755
--- a/init.sh
+++ b/init.sh
@@ -14,26 +14,5 @@ echo "Initializing day $DAY in directory $DIR"
14 14
15mkdir -p $DIR && 15mkdir -p $DIR &&
16 curl "https://adventofcode.com/$YEAR/day/$DAY/input" -H "Cookie: session=$ADVENT_SESSION" >$DIR/input.txt 16 curl "https://adventofcode.com/$YEAR/day/$DAY/input" -H "Cookie: session=$ADVENT_SESSION" >$DIR/input.txt
17echo \
18 'const std = @import("std");
19const print = std.debug.print;
20const assert = std.debug.assert;
21const ArrayList = std.ArrayList;
22const mem = std.mem;
23 17
24const fin = mem.trim(u8, @embedFile("./input.txt"), &std.ascii.whitespace); 18cp -n ./template.zig $DIR/solution.zig
25var gpa = std.heap.GeneralPurposeAllocator(.{}){};
26const allocator = gpa.allocator();
27
28pub fn part1() void {
29
30}
31
32pub fn part2() void {
33
34}
35
36pub fn main() !void {
37 part1();
38 part2();
39}' >$DIR/solution.zig
diff --git a/template.zig b/template.zig
new file mode 100644
index 0000000..059a120
--- /dev/null
+++ b/template.zig
@@ -0,0 +1,23 @@
1const std = @import("std");
2const print = std.debug.print;
3const assert = std.debug.assert;
4const ArrayList = std.ArrayList;
5const HashMap = std.HashMap;
6const mem = std.mem;
7
8const fin = mem.trim(u8, @embedFile("./input.txt"), &std.ascii.whitespace);
9var gpa = std.heap.GeneralPurposeAllocator(.{}){};
10const allocator = gpa.allocator();
11
12pub fn part1() void {
13 // Part 1 goes here
14}
15
16pub fn part2() void {
17 // Part 2 goes here
18}
19
20pub fn main() !void {
21 part1();
22 part2();
23}