~cricket/advent2020

6c216adde7ed7af08c63ab702b900cb2f1e142bb — cricket 9 months ago 6cbea23
dont slice the array literal

* that's literally all in this commit :-P
1 files changed, 1 insertions(+), 1 deletions(-)

M 3/main.zig
M 3/main.zig => 3/main.zig +1 -1
@@ 14,7 14,7 @@ fn slope(sx: usize, sy: usize) usize {
}

pub fn main() void {
    const slopes = ([_][2]u8{.{ 1, 1 }, .{ 3, 1 }, .{ 5, 1 }, .{ 7, 1 }, .{ 1, 2 }})[0..];
    const slopes = [_][2]u8{.{ 1, 1 }, .{ 3, 1 }, .{ 5, 1 }, .{ 7, 1 }, .{ 1, 2 }};
    var part1 = slope(3, 1);
    var part2: usize = 1; for (slopes) |s| part2 *= slope(s[0], s[1]);