Skip to content

Commit e164c68

Browse files
committed
fix(2024): re-enable part 1, cleanup
1 parent 58a287a commit e164c68

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

2024/day18.zig

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,20 +229,18 @@ fn parseInput(allocator: Allocator, input: []const u8) !MemorySpace {
229229

230230
fn part1(allocator: Allocator, input: []const u8) anyerror!void {
231231
var memory_space = try parseInput(allocator, input);
232-
233232
memory_space.markCorruptions(memory_space.corruption_idx);
234233

235-
std.debug.print("\n{s}", .{t.hide_cursor});
236-
std.debug.print("\n{s}", .{t.clear_screen});
234+
std.debug.print(t.hide_cursor, .{});
235+
std.debug.print(t.clear_screen, .{});
237236
const result = try memory_space.aStar(allocator, true);
238-
std.debug.print("\nResult: {d}", .{result});
237+
std.debug.print("\nResult: {any}", .{result});
239238
}
240239

241240
fn part2(allocator: Allocator, input: []const u8) anyerror!void {
242241
var memory_space = try parseInput(allocator, input);
243242

244243
log.info("# Total Corruptions: {d}", .{memory_space.corruptions.items.len});
245-
aoc.blockAskForNext();
246244

247245
var idx: usize = 2900;
248246
var blocking_pos = memory_space.corruptions.items[idx];
@@ -263,7 +261,7 @@ fn part2(allocator: Allocator, input: []const u8) anyerror!void {
263261
// Found no solution, there's a blocking corrupted memory block!
264262
blocking_pos = memory_space.corruptions.items[idx];
265263
std.debug.print("\nResult: {d}, {d}", .{ blocking_pos, memory_space.current_cell.?.pos });
266-
aoc.blockAskForNext();
264+
// aoc.blockAskForNext();
267265
}
268266
}
269267
}
@@ -273,6 +271,6 @@ pub fn main() !void {
273271
defer arena.deinit();
274272
const allocator = arena.allocator();
275273

276-
// try aoc.runPart(allocator, 2024, DAY, .PUZZLE, part1);
274+
try aoc.runPart(allocator, 2024, DAY, .PUZZLE, part1);
277275
try aoc.runPart(allocator, 2024, DAY, .PUZZLE, part2);
278276
}

0 commit comments

Comments
 (0)