From 7b5373a18f9dea31349baad3d3a7675e2426019e Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Fri, 9 Dec 2022 13:34:50 +0100 Subject: [PATCH] Advent of code day 9 --- day9.c3 | 88 +++ moves.txt | 2000 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 2088 insertions(+) create mode 100644 day9.c3 create mode 100644 moves.txt diff --git a/day9.c3 b/day9.c3 new file mode 100644 index 0000000..75d40b1 --- /dev/null +++ b/day9.c3 @@ -0,0 +1,88 @@ +module day9; +import std::io; +import std::math; +const MAP_SIZE = 400; + +struct State +{ + bool[MAP_SIZE][MAP_SIZE] map; + int[<2>] head; + int[<2>][] tail; +} + +fn void process_line(State* state, char dir, int steps) +{ + for (int s = 0; s < steps; s++) + { + switch (dir) + { + case 'R': state.head[0] += 1; + case 'L': state.head[0] -= 1; + case 'D': state.head[1] -= 1; + case 'U': state.head[1] += 1; + default: unreachable(); + } + assert(state.head[0] > -MAP_SIZE / 2 && state.head[1] > -MAP_SIZE / 2 && state.head[0] < MAP_SIZE / 2 && state.head[1] < MAP_SIZE / 2); + int tail_parts = state.tail.len; + int[<2>] last_part = state.head; + for (int i = 0; i < tail_parts; i++) + { + int[<2>] tail = state.tail[i]; + int[<2>] diff = last_part - tail; + int x_diff = math::abs(diff[0]); + int y_diff = math::abs(diff[1]); + switch + { + case x_diff > 1 && y_diff > 1: + assert(y_diff == 2 && x_diff == 2); + tail[0] += diff[0] / 2; + tail[1] += diff[1] / 2; + case x_diff > 1: + assert(y_diff < 2 && x_diff == 2); + tail[0] += diff[0] / 2; + tail[1] += diff[1]; + case y_diff > 1: + assert(x_diff < 2 && y_diff == 2); + tail[0] += diff[0]; + tail[1] += diff[1] / 2; + default: + break; + } + state.tail[i] = tail; + last_part = tail; + if (i == tail_parts - 1) + { + state.map[tail[0] + MAP_SIZE / 2][tail[1] + MAP_SIZE / 2] = true; + } + } + } +} + +macro void part(int $part) +{ + State state; + state.map[MAP_SIZE / 2][MAP_SIZE / 2] = true; + int[<2>][$part == 1 ? 1 : 9] tail; + state.tail = &tail; + File f; + f.open("moves.txt", "rb")!!; + defer catch(f.close()); + while (!f.eof()) + { + char[] line = f.tgetline(); + assert(line.len); + process_line(&state, line[0], str::to_int(line[2..])!!); + } + int sum = 0; + foreach (bool[MAP_SIZE]* &row : state.map) + { + foreach (val : *row) if (val) sum++; + } + io::printfln("Grids visited by the tail: %d", sum); +} + +fn void main() +{ + part(1); + part(2); +} \ No newline at end of file diff --git a/moves.txt b/moves.txt new file mode 100644 index 0000000..ce34819 --- /dev/null +++ b/moves.txt @@ -0,0 +1,2000 @@ +U 2 +L 1 +U 1 +D 2 +L 2 +D 1 +L 2 +R 2 +D 2 +U 2 +L 2 +D 1 +L 2 +U 1 +R 2 +D 2 +R 1 +U 1 +R 1 +L 1 +D 2 +R 1 +D 2 +R 2 +D 2 +L 2 +U 1 +R 1 +L 1 +D 2 +L 1 +R 1 +U 1 +D 1 +R 1 +D 2 +R 2 +L 1 +R 2 +L 2 +U 1 +L 1 +D 2 +U 2 +D 1 +R 2 +L 2 +D 1 +R 1 +D 2 +U 1 +D 2 +R 2 +U 2 +L 2 +D 2 +R 2 +L 1 +D 2 +L 1 +U 2 +R 1 +L 2 +U 1 +R 2 +U 1 +D 2 +R 2 +U 1 +D 2 +L 2 +D 2 +L 1 +R 1 +D 1 +L 2 +D 2 +U 2 +R 1 +U 1 +R 2 +U 2 +L 2 +R 2 +L 2 +R 1 +U 2 +L 2 +R 1 +D 1 +L 1 +D 1 +U 2 +R 1 +U 2 +R 2 +U 2 +L 2 +U 2 +L 2 +U 1 +R 1 +U 2 +R 2 +L 2 +R 2 +U 1 +R 1 +D 1 +U 1 +L 2 +R 3 +L 2 +U 3 +L 1 +R 1 +U 1 +D 1 +U 1 +D 1 +R 3 +U 3 +L 3 +U 1 +R 2 +D 1 +U 2 +D 2 +U 3 +L 2 +U 3 +R 1 +L 2 +U 1 +L 2 +D 2 +U 3 +D 1 +R 3 +U 3 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 15 +R 15 +D 3 +U 17 +R 5 +L 2 +R 15 +D 13 +L 2 +U 4 +L 6 +R 5 +L 5 +R 4 +L 9 +U 3 +L 9 +R 15 +L 4 +R 1 +U 3 +L 1 +D 3 +R 9 +D 9 +L 10 +R 14 +L 18 +U 7 +R 11 +L 6 +R 16 +U 9 +R 5 +U 5 +R 9 +D 9 +L 12 +D 18 +L 11 +D 18 +L 2 +D 8 +R 6 +L 1 +U 11 +L 6 +U 18 +L 8 +D 12 +L 8 +R 15 +L 15 +R 13 +L 10 +D 15 +R 10 +L 11 +R 14 +D 6 +L 9 +U 3 +R 10 +U 18 +R 9 +L 9 +D 4 +L 17 +D 16 +U 10 +R 14 +L 15 +R 5 +U 2 +L 4 +R 15 +U 2 +D 2 +R 9 +U 14 +D 17 +U 5 +R 1 +U 15 +R 17 +D 4 +R 7 +L 4 +R 16 +L 11 +U 10 +R 3 +D 2 +L 5 +R 14 +L 4 +D 11 +L 11 +U 6 +R 9 +U 3 +R 17 +D 16 +R 18 +L 10 +R 15 +L 14 +R 16 +L 12 +U 3 +R 9 +D 17 +R 6 +L 1 +R 16 +L 8 +U 16 +R 6 +L 1 +U 4 +L 17 +R 4 +U 15 +R 19 +D 7 +R 18 +L 16 +R 18 +U 2 +D 11 +L 17 +R 2 +L 10 +U 17 +D 11 +R 17 +U 1 +D 15 +U 6 +D 19 +R 16 +D 12 +L 7 +R 13 +D 14 +L 12 +U 14 +L 5 +R 5 +D 3 +L 10 +U 16 +R 14 +D 16 +L 9 +D 16 +L 10 +R 11 +D 11 +U 19 +L 4 +D 16 +R 8 +D 1 +U 4 +L 15 +R 5 +D 1 +L 19 +D 19 +R 12 +L 18 +D 13 +L 4 +U 6 +R 5 +D 12 +R 15 +D 9 +L 9 +U 16 +D 1 +R 16 +L 7 +R 6 +D 12 +L 7 +R 8 +U 17 +L 12 +D 9 +L 8 +D 16 +R 8 +D 9 +L 17 +R 3 +U 6 +D 1 +R 7 +L 4 +D 10 +U 7 +R 13 +L 10 +D 19 +U 7 +D 10 +L 17 +R 18 +D 15 +R 6 +L 7 +R 8 +U 16 +R 6 +D 3 +L 19 +D 10 +R 12 +U 13 +L 11 \ No newline at end of file