summaryrefslogtreecommitdiff
path: root/src/day01.zig
diff options
context:
space:
mode:
authorXander Bil <xander@biltopia.org>2024-12-04 23:58:20 +0100
committerXander Bil <xander@biltopia.org>2024-12-04 23:58:20 +0100
commit7b47337e40672c4c5f12a2773d3888c17237f36a (patch)
tree734e104dacaeb4708912449aac28a074f225acc5 /src/day01.zig
parent1c2490f5f2c9419ddb5035fc3a8967beef691e6c (diff)
downloadaoc2024-7b47337e40672c4c5f12a2773d3888c17237f36a.tar.xz
aoc2024-7b47337e40672c4c5f12a2773d3888c17237f36a.zip
solutions day3 and 4
Diffstat (limited to 'src/day01.zig')
-rw-r--r--src/day01.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/day01.zig b/src/day01.zig
index 33b0a67..d92e756 100644
--- a/src/day01.zig
+++ b/src/day01.zig
@@ -8,7 +8,7 @@ pub fn solve(part: []u8, buffer: []u8, allocator: std.mem.Allocator) !void {
defer left.deinit();
defer right.deinit();
- if (std.mem.eql(u8, part, "part1")) {
+ if (std.mem.eql(u8, part, "1")) {
try part1(&lines, &left, &right, allocator);
} else {
try part2(&lines, &left, &right, allocator);
@@ -41,7 +41,7 @@ fn part1(lines: *std.mem.SplitIterator(u8, .scalar), left: *std.ArrayList(usize)
}
}
- print("Sum is {d}\n", .{sum});
+ print("{d}\n", .{sum});
}
fn part2(lines: *std.mem.SplitIterator(u8, .scalar), left: *std.ArrayList(usize), right: *std.ArrayList(usize), allocator: std.mem.Allocator) !void {
@@ -77,5 +77,5 @@ fn part2(lines: *std.mem.SplitIterator(u8, .scalar), left: *std.ArrayList(usize)
};
}
- print("Sum is {d}\n", .{sum});
+ print("{d}\n", .{sum});
}