From 3521330407bac556ab075cae0dd5d27ddc313d6c Mon Sep 17 00:00:00 2001 From: Martin Ashby Date: Mon, 4 Dec 2023 20:53:21 +0000 Subject: Day4 Plus fixes var -> const for latest zig version --- day3.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'day3.zig') diff --git a/day3.zig b/day3.zig index 04c432f..9bea1ab 100644 --- a/day3.zig +++ b/day3.zig @@ -17,7 +17,7 @@ const Grid = struct { span_ix: []usize, // grid mapping of index into spans list fn init(a: std.mem.Allocator, input: []const u8) !Grid { - var spix = try a.alloc(usize, input.len); + const spix = try a.alloc(usize, input.len); @memset(spix, std.math.maxInt(usize)); errdefer a.free(spix); @@ -173,10 +173,10 @@ fn solve_pt2(a: std.mem.Allocator, input: []const u8) !u32 { } var ki = spixes.keyIterator(); if (ki.next()) |first| { - var m = allSpans.items[first.*]; + const m = allSpans.items[first.*]; //std.log.warn("span val m{}", .{m}); if (ki.next()) |second| { - var m2 = allSpans.items[second.*]; + const m2 = allSpans.items[second.*]; //std.log.warn("span val m2{}", .{m2}); // _EXACTLY_ two gears! if (ki.next() == null) { -- cgit v1.2.3-ZIG