made build.zig.
Has runner and tester for each day, as well as a runner and tester for all the days. Also has check step for zls.
This commit is contained in:
parent
0a9f08cbf0
commit
560db87929
10 changed files with 139 additions and 29 deletions
0
src/days/template/input.txt
Normal file
0
src/days/template/input.txt
Normal file
1
src/days/template/lib.zig
Normal file
1
src/days/template/lib.zig
Normal file
|
@ -0,0 +1 @@
|
|||
const std = @import("std");
|
10
src/days/template/main.zig
Normal file
10
src/days/template/main.zig
Normal file
|
@ -0,0 +1,10 @@
|
|||
const std = @import("std");
|
||||
const part1 = @import("part1.zig");
|
||||
const part2 = @import("part2.zig");
|
||||
const input = @embedFile("input.txt");
|
||||
|
||||
pub fn main() !void {
|
||||
const stdout = std.io.getStdErr().writer();
|
||||
try stdout.print("Part1: {d}\n", .{part1.solve(input)});
|
||||
try stdout.print("Part2: {d}\n", .{part2.solve(input)});
|
||||
}
|
14
src/days/template/part1.zig
Normal file
14
src/days/template/part1.zig
Normal file
|
@ -0,0 +1,14 @@
|
|||
const lib = @import("lib.zig");
|
||||
const std = @import("std");
|
||||
const utils = @import("utils");
|
||||
|
||||
pub fn solve(comptime input: []const u8) i32 {
|
||||
return input.len;
|
||||
}
|
||||
|
||||
test "part1 sample" {
|
||||
const input =
|
||||
\\0
|
||||
;
|
||||
try std.testing.expectEqual(solve(input), 1);
|
||||
}
|
14
src/days/template/part2.zig
Normal file
14
src/days/template/part2.zig
Normal file
|
@ -0,0 +1,14 @@
|
|||
const lib = @import("lib.zig");
|
||||
const std = @import("std");
|
||||
const utils = @import("utils");
|
||||
|
||||
pub fn solve(comptime input: []const u8) i32 {
|
||||
return input.len;
|
||||
}
|
||||
|
||||
test "part2 sample" {
|
||||
const input =
|
||||
\\0
|
||||
;
|
||||
try std.testing.expectEqual(solve(input), 1);
|
||||
}
|
1
src/utils/mod.zig
Normal file
1
src/utils/mod.zig
Normal file
|
@ -0,0 +1 @@
|
|||
const std = @import("std");
|
Loading…
Add table
Add a link
Reference in a new issue