~cricket/advent2020

4e22035a4bda0f1dcfcab5b6e55bb9714acd3377 — cricket 2 months ago e66899a
day 5: i do not like this day
3 files changed, 924 insertions(+), 1 deletions(-)

M 3/main.zig
A 5/input
A 5/main.zig
M 3/main.zig => 3/main.zig +1 -1
@@ 4,4 4,4 @@ fn slope(sx:usize,sy:usize)usize{var t:usize=0;var x=t;var y=t;var i=t;
    return t;}
pub fn main()void{var p1=slope(3,1);var p2:usize=1;
    for ([_][2]u8{.{1,1},.{3,1},.{5,1},.{7,1},.{1,2}})|s|p2*=slope(s[0],s[1]);
    std.debug.print("part 1: {}\npart 2: {}\n",.{p2,p2});}
    std.debug.print("part 1: {}\npart 2: {}\n",.{p1,p2});}

A 5/input => 5/input +868 -0
@@ 0,0 1,868 @@
FBFBFFBLLR
FBBBFFBLLL
BFBFFFFRRR
BFBBBFBRLL
FBFBBFBLLL
BBBFFFBRRR
FBFFFBFRRL
BFFFFFFRLR
FBFFBBFRRL
FBFBBFBRLL
BFBBBFBRRR
BBFBFFBRLL
FBBFBFFLLL
FBBFFFBRLR
BBFFFFBLRL
FFFBBBBRLR
FFBBBFBRLL
FBBBFBFLLL
FBBBFFFRLL
FBBFBBFLRR
FBFBBBBLLL
BBFBFBFLRR
FBFFFBFRLR
FFFBBFBLLL
FBFFBBBRLL
FBBBFBFLRL
BFFFBFBRRL
BFFBFFBLRR
BBFBBBBRRL
FBFBBBBRRR
BBBFFBBLRL
BBFBFFFRRR
FFBBBBBRRL
BFFBBFFLLR
BBFFFFBRRR
FBFBFFFRLL
FFFBFBBLLL
FBBFBFBLRR
FBFBFBFLLL
BFFFFFFLRR
BFFBBFFRLL
FFBFBBFLLL
FBFBBBFRLL
BFFFFFFLLR
FFFBFBFRLR
FBFFFFBLLL
FFBFBBBLLL
BBFFBBBLRL
BBFBBBBLRR
BFBFBFFRLL
FFFBFBBRLL
FBBBFBBRLL
FBFFFFFLRR
BFFBFBBRLR
BFFBBBBRRR
FBBBBBFLRR
BFFFBFFRRL
FBF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BFBBFFFRRL
BBFBFBFLRL
FBBBBBBRLL
FBBFBFFLRL
FBFBFBFLRL
BFBFBFFRRL
BFBBFFBRRR
FBFFFBFLLR
FBBBFFFLRL
BFBBFFBLLR
FFBFFFFLLL
BFBBFFFLRR
FBBFBFFLLR
BBBFFBBRLR
FFBFBBBLLR
FBFBFFBRRL
FFBBFBFLLR
BFFBFBFRLR
BFFBFFBLLR
BBBFBFFLLL
FFBFFBFLLR
FFFBBBBLRR
FFFBFFBRRL
FBBBFFFRRL
BBFFFBBRRL
BBFBBFBLRR
BBFFBBBRRL
BBFBFBBRLL
BFFFFFFRLL
BFFBFFFLRL
BFFFFBFRRR
BFFFBFFLRL
BFBFFBBLRR
FFBBFBBRLR
BFBBBBBRRR
BFFBBFFRRL
FFBFFFBLLL
FBBFBBFRLR
BBFFBBBLLR
FFFBBFFRRL
FFFBBFBLRR
FBFBFBBLRR
FBBBFFFLLL
FFBFBFBLLR
BFBBFFBRLR
BFFFFBBLLL
BFBBBBFLRL
FBBBBBBLLR
BFFFFBBRRR
BBFFFBBLLR
FFBBBFFLLR
FFFBFBFRRL
BFFFFBFRLL
BFFBBBBRLR
FBFFBFBLLR
FBBFFBBLRR
BBBFFBBLRR
BFFBFBBRLL
BFBFBFFLLR
FFBFBFBRRL
BBFFBBFRRR
FFBFBFBRLR
FBBFFFFLLR
FBBFBFFRRL
FBFFBBFRRR
FBBBBFBLRL
\ No newline at end of file

A 5/main.zig => 5/main.zig +55 -0
@@ 0,0 1,55 @@
const std = @import("std");
const input = @embedFile("input");
const mem = std.mem;
const fmt = std.fmt;

const print = std.debug.print;

fn array_list(a: *mem.Allocator) !std.ArrayList([]const u8) {
    var strings = mem.split(input, "\n");
    var list = std.ArrayList([]const u8).init(a);
    while (strings.next()) |string| {
        try list.append(string);
    }
    return list;
}

fn divCeil(x: usize, y: usize) usize {
    return (x/y) + @boolToInt(x%y != 0);
}

pub fn parts(slice: [][]const u8, a: *mem.Allocator) [2]usize {
    var ids = std.AutoHashMap(usize, bool).init(a);
    var max: usize = 0;
    for (slice) |item| {
        var row: [2]usize = .{0, 127};
        var column: [2]usize = .{0, 7};
        for (item) |c| {
            switch (c) {
                'F' => row[1] = @divFloor(row[1] + row[0], 2),
                'B' => row[0] = divCeil(row[1] + row[0], 2),
                'L' => column[1] = @divFloor(column[1] + column[0], 2),
                'R' => column[0] = divCeil(column[1] + column[0], 2),
                else => unreachable
            }
        }
        var id = row[0] * 8 + column[1];
        ids.put(id, true) catch unreachable;
        if (id > max) max = id;
    }
    var i: usize = max;
    while (i > 0) : ( i -= 1 ) {
        _ = ids.get(i) orelse return .{max, i};
    }
    return .{0, 0};
}

pub fn main() !void {
    var gpa = std.heap.GeneralPurposeAllocator(.{}){};
    const a = &gpa.allocator;
    var list = try array_list(a);
    const slice = list.items;

    var p = parts(slice, a);
    print("part 1: {}\npart 2: {}\n", .{p[0], p[1]});
}
\ No newline at end of file