diff options
author | Xander Bil <xander@biltopia.org> | 2024-12-04 23:58:20 +0100 |
---|---|---|
committer | Xander Bil <xander@biltopia.org> | 2024-12-04 23:58:20 +0100 |
commit | 7b47337e40672c4c5f12a2773d3888c17237f36a (patch) | |
tree | 734e104dacaeb4708912449aac28a074f225acc5 /src/day02.zig | |
parent | 1c2490f5f2c9419ddb5035fc3a8967beef691e6c (diff) | |
download | aoc2024-7b47337e40672c4c5f12a2773d3888c17237f36a.tar.xz aoc2024-7b47337e40672c4c5f12a2773d3888c17237f36a.zip |
solutions day3 and 4
Diffstat (limited to 'src/day02.zig')
-rw-r--r-- | src/day02.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/day02.zig b/src/day02.zig index cad2d9d..e87b234 100644 --- a/src/day02.zig +++ b/src/day02.zig @@ -4,7 +4,7 @@ const print = std.debug.print; pub fn solve(part: []u8, buffer: []u8) !void { var lines = std.mem.splitScalar(u8, buffer, '\n'); - if (std.mem.eql(u8, part, "part1")) { + if (std.mem.eql(u8, part, "1")) { try part1(&lines); } else { try part2(&lines); @@ -38,7 +38,7 @@ fn part1(lines: *std.mem.SplitIterator(u8, .scalar)) !void { } } - print("Safe count: {d}\n", .{count}); + print("{d}\n", .{count}); } fn part2(lines: *std.mem.SplitIterator(u8, .scalar)) !void { @@ -87,5 +87,5 @@ fn part2(lines: *std.mem.SplitIterator(u8, .scalar)) !void { } } } - print("Safe count: {d}\n", .{count}); + print("{d}\n", .{count}); } |