diff options
author | Martin Ashby <martin@ashbysoft.com> | 2023-12-04 20:53:21 +0000 |
---|---|---|
committer | Martin Ashby <martin@ashbysoft.com> | 2023-12-04 20:53:21 +0000 |
commit | 3521330407bac556ab075cae0dd5d27ddc313d6c (patch) | |
tree | d57d7ff40315ca49b58d390e97da6e0eaff77dda /day3.zig | |
parent | b3b47eb8664a6f530fb33df6a1a5ffbe6c86cb32 (diff) | |
download | aoc2023-3521330407bac556ab075cae0dd5d27ddc313d6c.tar.gz aoc2023-3521330407bac556ab075cae0dd5d27ddc313d6c.tar.bz2 aoc2023-3521330407bac556ab075cae0dd5d27ddc313d6c.tar.xz aoc2023-3521330407bac556ab075cae0dd5d27ddc313d6c.zip |
Day4
Plus fixes var -> const for latest zig version
Diffstat (limited to 'day3.zig')
-rw-r--r-- | day3.zig | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) { |