From 510ff33dd7ae492e2f8f13c3652a7e3d7a421ef9 Mon Sep 17 00:00:00 2001 From: Martin Wickham Date: Tue, 23 Nov 2021 22:56:51 -0600 Subject: [PATCH] Update for 2021 --- .gitignore | 1 + .vscode/launch.json | 50 ++++++++++++++++++++++----------------------- build.zig | 27 +++++++++++++++--------- src/day01.zig | 11 +++++++++- src/day02.zig | 11 +++++++++- src/day03.zig | 11 +++++++++- src/day04.zig | 11 +++++++++- src/day05.zig | 11 +++++++++- src/day06.zig | 11 +++++++++- src/day07.zig | 11 +++++++++- src/day08.zig | 11 +++++++++- src/day09.zig | 11 +++++++++- src/day10.zig | 11 +++++++++- src/day11.zig | 11 +++++++++- src/day12.zig | 11 +++++++++- src/day13.zig | 11 +++++++++- src/day14.zig | 11 +++++++++- src/day15.zig | 11 +++++++++- src/day16.zig | 11 +++++++++- src/day17.zig | 11 +++++++++- src/day18.zig | 11 +++++++++- src/day19.zig | 11 +++++++++- src/day20.zig | 11 +++++++++- src/day21.zig | 11 +++++++++- src/day22.zig | 11 +++++++++- src/day23.zig | 11 +++++++++- src/day24.zig | 11 +++++++++- src/day25.zig | 11 +++++++++- 28 files changed, 293 insertions(+), 60 deletions(-) diff --git a/.gitignore b/.gitignore index 932a483..9f71afc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ zig-cache/ +zig-out/ build_runner.zig diff --git a/.vscode/launch.json b/.vscode/launch.json index cf5a479..3a78b2a 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,7 +8,7 @@ "name": "day 01", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day01.exe", + "program": "${workspaceFolder}/zig-out/bin/day01.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -20,7 +20,7 @@ "name": "day 02", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day02.exe", + "program": "${workspaceFolder}/zig-out/bin/day02.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -32,7 +32,7 @@ "name": "day 03", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day03.exe", + "program": "${workspaceFolder}/zig-out/bin/day03.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -44,7 +44,7 @@ "name": "day 04", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day04.exe", + "program": "${workspaceFolder}/zig-out/bin/day04.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -56,7 +56,7 @@ "name": "day 05", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day05.exe", + "program": "${workspaceFolder}/zig-out/bin/day05.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -68,7 +68,7 @@ "name": "day 06", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day06.exe", + "program": "${workspaceFolder}/zig-out/bin/day06.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -80,7 +80,7 @@ "name": "day 07", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day07.exe", + "program": "${workspaceFolder}/zig-out/bin/day07.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -92,7 +92,7 @@ "name": "day 08", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day08.exe", + "program": "${workspaceFolder}/zig-out/bin/day08.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -104,7 +104,7 @@ "name": "day 09", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day09.exe", + "program": "${workspaceFolder}/zig-out/bin/day09.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -116,7 +116,7 @@ "name": "day 10", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day10.exe", + "program": "${workspaceFolder}/zig-out/bin/day10.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -128,7 +128,7 @@ "name": "day 11", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day11.exe", + "program": "${workspaceFolder}/zig-out/bin/day11.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -140,7 +140,7 @@ "name": "day 12", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day12.exe", + "program": "${workspaceFolder}/zig-out/bin/day12.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -152,7 +152,7 @@ "name": "day 13", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day13.exe", + "program": "${workspaceFolder}/zig-out/bin/day13.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -164,7 +164,7 @@ "name": "day 14", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day14.exe", + "program": "${workspaceFolder}/zig-out/bin/day14.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -176,7 +176,7 @@ "name": "day 15", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day15.exe", + "program": "${workspaceFolder}/zig-out/bin/day15.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -188,7 +188,7 @@ "name": "day 16", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day16.exe", + "program": "${workspaceFolder}/zig-out/bin/day16.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -200,7 +200,7 @@ "name": "day 17", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day17.exe", + "program": "${workspaceFolder}/zig-out/bin/day17.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -212,7 +212,7 @@ "name": "day 18", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day18.exe", + "program": "${workspaceFolder}/zig-out/bin/day18.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -224,7 +224,7 @@ "name": "day 19", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day19.exe", + "program": "${workspaceFolder}/zig-out/bin/day19.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -236,7 +236,7 @@ "name": "day 20", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day20.exe", + "program": "${workspaceFolder}/zig-out/bin/day20.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -248,7 +248,7 @@ "name": "day 21", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day21.exe", + "program": "${workspaceFolder}/zig-out/bin/day21.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -260,7 +260,7 @@ "name": "day 22", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day22.exe", + "program": "${workspaceFolder}/zig-out/bin/day22.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -272,7 +272,7 @@ "name": "day 23", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day23.exe", + "program": "${workspaceFolder}/zig-out/bin/day23.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -284,7 +284,7 @@ "name": "day 24", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day24.exe", + "program": "${workspaceFolder}/zig-out/bin/day24.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -296,7 +296,7 @@ "name": "day 25", "type": "cppvsdbg", "request": "launch", - "program": "${workspaceFolder}/zig-cache/bin/day25.exe", + "program": "${workspaceFolder}/zig-out/bin/day25.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", diff --git a/build.zig b/build.zig index 830fef8..10de16e 100644 --- a/build.zig +++ b/build.zig @@ -5,12 +5,13 @@ const LibExeObjStep = std.build.LibExeObjStep; // set this to true to link libc const should_link_libc = false; -const test_files = [_][]const u8 { +const test_files = [_][]const u8{ // list any zig files with tests here }; fn linkObject(b: *Builder, obj: *LibExeObjStep) void { if (should_link_libc) obj.linkLibC(); + _ = b; // Add linking for packages or third party libraries here } @@ -26,14 +27,15 @@ pub fn build(b: *Builder) void { // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. const mode = b.standardReleaseOptions(); - // Set up an exe for each day - comptime var day = 1; - inline while (day <= 25) : (day += 1) { - @setEvalBranchQuota(100000); // this comptimePrint is pretty expensive - const dayString = comptime std.fmt.comptimePrint("day{:0>2}", .{ day }); - const zigFile = "src/" ++ dayString ++ ".zig"; + const install_all = b.step("install_all", "Install all days"); + const run_all = b.step("run_all", "Run all days"); + + // Set up an exe for each day + var day: u32 = 1; + while (day <= 25) : (day += 1) { + const dayString = b.fmt("day{:0>2}", .{day}); + const zigFile = b.fmt("src/{s}.zig", .{dayString}); - const exe = b.addExecutable(dayString, zigFile); exe.setTarget(target); exe.setBuildMode(mode); @@ -43,8 +45,11 @@ pub fn build(b: *Builder) void { const install_cmd = b.addInstallArtifact(exe); - const install_step = b.step("install_" ++ dayString, "Install " ++ dayString ++ ".exe"); + const step_key = b.fmt("install_{s}", .{dayString}); + const step_desc = b.fmt("Install {s}.exe", .{dayString}); + const install_step = b.step(step_key, step_desc); install_step.dependOn(&install_cmd.step); + install_all.dependOn(&install_cmd.step); const run_cmd = exe.run(); run_cmd.step.dependOn(&install_cmd.step); @@ -52,8 +57,10 @@ pub fn build(b: *Builder) void { run_cmd.addArgs(args); } - const run_step = b.step(dayString, "Run " ++ dayString); + const run_desc = b.fmt("Run {s}", .{dayString}); + const run_step = b.step(dayString, run_desc); run_step.dependOn(&run_cmd.step); + run_all.dependOn(&run_cmd.step); } // Set up a step to run all tests diff --git a/src/day01.zig b/src/day01.zig index 1f1d51c..80e89e2 100644 --- a/src/day01.zig +++ b/src/day01.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day01.txt"); pub fn main() !void { - + } diff --git a/src/day02.zig b/src/day02.zig index 1f1d51c..9e7b6ed 100644 --- a/src/day02.zig +++ b/src/day02.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day02.txt"); pub fn main() !void { - + } diff --git a/src/day03.zig b/src/day03.zig index 1f1d51c..84310cc 100644 --- a/src/day03.zig +++ b/src/day03.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day03.txt"); pub fn main() !void { - + } diff --git a/src/day04.zig b/src/day04.zig index 1f1d51c..e944570 100644 --- a/src/day04.zig +++ b/src/day04.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day04.txt"); pub fn main() !void { - + } diff --git a/src/day05.zig b/src/day05.zig index 1f1d51c..809f9d2 100644 --- a/src/day05.zig +++ b/src/day05.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day05.txt"); pub fn main() !void { - + } diff --git a/src/day06.zig b/src/day06.zig index 1f1d51c..308a012 100644 --- a/src/day06.zig +++ b/src/day06.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day06.txt"); pub fn main() !void { - + } diff --git a/src/day07.zig b/src/day07.zig index 1f1d51c..9598e17 100644 --- a/src/day07.zig +++ b/src/day07.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day07.txt"); pub fn main() !void { - + } diff --git a/src/day08.zig b/src/day08.zig index 1f1d51c..ab2869c 100644 --- a/src/day08.zig +++ b/src/day08.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day08.txt"); pub fn main() !void { - + } diff --git a/src/day09.zig b/src/day09.zig index 1f1d51c..6b78080 100644 --- a/src/day09.zig +++ b/src/day09.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day09.txt"); pub fn main() !void { - + } diff --git a/src/day10.zig b/src/day10.zig index 1f1d51c..c501b71 100644 --- a/src/day10.zig +++ b/src/day10.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day10.txt"); pub fn main() !void { - + } diff --git a/src/day11.zig b/src/day11.zig index 1f1d51c..913ae0c 100644 --- a/src/day11.zig +++ b/src/day11.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day11.txt"); pub fn main() !void { - + } diff --git a/src/day12.zig b/src/day12.zig index 1f1d51c..9ee965f 100644 --- a/src/day12.zig +++ b/src/day12.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day12.txt"); pub fn main() !void { - + } diff --git a/src/day13.zig b/src/day13.zig index 1f1d51c..7309e9b 100644 --- a/src/day13.zig +++ b/src/day13.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day13.txt"); pub fn main() !void { - + } diff --git a/src/day14.zig b/src/day14.zig index 1f1d51c..194bfdd 100644 --- a/src/day14.zig +++ b/src/day14.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day14.txt"); pub fn main() !void { - + } diff --git a/src/day15.zig b/src/day15.zig index 1f1d51c..0ee0434 100644 --- a/src/day15.zig +++ b/src/day15.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day15.txt"); pub fn main() !void { - + } diff --git a/src/day16.zig b/src/day16.zig index 1f1d51c..f67c08f 100644 --- a/src/day16.zig +++ b/src/day16.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day16.txt"); pub fn main() !void { - + } diff --git a/src/day17.zig b/src/day17.zig index 1f1d51c..57fcdb8 100644 --- a/src/day17.zig +++ b/src/day17.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day17.txt"); pub fn main() !void { - + } diff --git a/src/day18.zig b/src/day18.zig index 1f1d51c..ea6a8a3 100644 --- a/src/day18.zig +++ b/src/day18.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day18.txt"); pub fn main() !void { - + } diff --git a/src/day19.zig b/src/day19.zig index 1f1d51c..38ba985 100644 --- a/src/day19.zig +++ b/src/day19.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day19.txt"); pub fn main() !void { - + } diff --git a/src/day20.zig b/src/day20.zig index 1f1d51c..245feea 100644 --- a/src/day20.zig +++ b/src/day20.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day20.txt"); pub fn main() !void { - + } diff --git a/src/day21.zig b/src/day21.zig index 1f1d51c..53c24af 100644 --- a/src/day21.zig +++ b/src/day21.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day21.txt"); pub fn main() !void { - + } diff --git a/src/day22.zig b/src/day22.zig index 1f1d51c..0dfe19b 100644 --- a/src/day22.zig +++ b/src/day22.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day22.txt"); pub fn main() !void { - + } diff --git a/src/day23.zig b/src/day23.zig index 1f1d51c..dfffed4 100644 --- a/src/day23.zig +++ b/src/day23.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day23.txt"); pub fn main() !void { - + } diff --git a/src/day24.zig b/src/day24.zig index 1f1d51c..75a0a00 100644 --- a/src/day24.zig +++ b/src/day24.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day24.txt"); pub fn main() !void { - + } diff --git a/src/day25.zig b/src/day25.zig index 1f1d51c..09cd674 100644 --- a/src/day25.zig +++ b/src/day25.zig @@ -2,7 +2,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; +const ArrayList = std.ArrayList; +const HashMap = std.AutoHashMap; +const StringHashMap = std.StringHashMap; +const BitSet = std.DynamicBitSet; + +var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; +const gpa = &gpa_impl.allocator; + +const data = @embedFile("../data/day25.txt"); pub fn main() !void { - + }