const std = @import("std"); const aoc2021 = struct { const day01a = @import("day01a.zig"); const day01b = @import("day01b.zig"); const day02a = @import("day02a.zig"); const day02b = @import("day02b.zig"); const day03a = @import("day03a.zig"); const day03b = @import("day03b.zig"); const day04a = @import("day04a.zig"); const day04b = @import("day04b.zig"); const day05a = @import("day05a.zig"); const day05b = @import("day05b.zig"); const day06a = @import("day06a.zig"); const day06b = @import("day06b.zig"); const day07a = @import("day07a.zig"); const day07b = @import("day07b.zig"); const day08a = @import("day08a.zig"); const day08b = @import("day08b.zig"); const day09a = @import("day09a.zig"); const day09b = @import("day09b.zig"); const day10a = @import("day10a.zig"); const day10b = @import("day10b.zig"); const day11a = @import("day11a.zig"); const day11b = @import("day11b.zig"); const day12a = @import("day12a.zig"); const day12b = @import("day12b.zig"); const day13a = @import("day13a.zig"); const day13b = @import("day13b.zig"); const day14a = @import("day14a.zig"); const day14b = @import("day14b.zig"); const day15a = @import("day15a.zig"); const day15b = @import("day15b.zig"); const day16a = @import("day16a.zig"); const day16b = @import("day16b.zig"); const day17a = @import("day17a.zig"); const day17b = @import("day17b.zig"); const day18a = @import("day18a.zig"); const day18b = @import("day18b.zig"); const day19a = @import("day19a.zig"); const day19b = @import("day19b.zig"); const day20a = @import("day20a.zig"); const day20b = @import("day20b.zig"); const day21a = @import("day21a.zig"); const day21b = @import("day21b.zig"); const day22a = @import("day22a.zig"); const day22b = @import("day22b.zig"); const day23a = @import("day23a.zig"); const day23b = @import("day23b.zig"); const day24a = @import("day24a.zig"); const day24b = @import("day24b.zig"); const day25a = @import("day25a.zig"); }; const days = 25; pub fn main() anyerror!void { var timer = try std.time.Timer.start(); var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator); defer arena.deinit(); comptime var day: u5 = 0; inline while (day < days) : (day += 1) { comptime var bufa: [6]u8 = undefined; comptime var bufb: [6]u8 = undefined; const dsa = comptime try std.fmt.bufPrint(&bufa, "day{d:0>2}a", .{day + 1}); const dsb = comptime try std.fmt.bufPrint(&bufb, "day{d:0>2}b", .{day + 1}); _ = @field(aoc2021, dsa).first(arena.allocator()) catch unreachable; if (day < 24) _ = @field(aoc2021, dsb).second(arena.allocator()) catch unreachable; } const t = timer.lap() / std.time.ns_per_ms; std.debug.print("Total running time: {d}ms\n", .{t}); }