solve_day2 :: (test: bool) {
    contents := read_entire_file(ifx test then "inputs/day2_test.txt" else "inputs/day2.txt");
    lines := split(contents, cast(u8) #char "\n");

    depth          := 0;
    horizontal_pos := 0;

    aim := 0;
    horizontal_pos_2 := 0;
    depth_2          := 0;

    for line: lines {
        space_index := find_index_from_left(line, cast(u8) #char " ");
        if begins_with(line, "forward") {
            num := string_to_int(slice(line, space_index, line.count - space_index));
            horizontal_pos += num;
            depth_2 += aim * num;
            horizontal_pos_2 += num;
        } else if begins_with(line, "down") {
            num := string_to_int(slice(line, space_index, line.count - space_index));
            aim += num;
            depth += num;
        } else if begins_with(line, "up") {
            num := string_to_int(slice(line, space_index, line.count - space_index));
            aim -= num;
            depth -= num;
        } else {
            assert(false, "Unknown direction: '%'", line);
        }
    }

    print("Part 1: %\n", horizontal_pos * depth);
    print("Part 2: %\n", horizontal_pos_2 * depth_2);
}