From cb10768fa14c4b6ec19d050e13a0c3e00c152874 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Wed, 16 Dec 2020 18:06:36 -0500 Subject: move project to subdirectory and add unit testing day 13 is removed from the test so it doesn't take 4 years --- .drone.yml | 9 +- Day.cs | 49 -- Day01.cs | 43 -- Day02.cs | 46 -- Day03.cs | 57 -- Day04.cs | 49 -- Day05.cs | 78 --- Day06.cs | 38 -- Day07.cs | 67 --- Day08.cs | 38 -- Day09.cs | 29 - Day10.cs | 73 --- Day11.cs | 112 ---- Day12.cs | 127 ----- Day13.cs | 87 --- Day14.cs | 110 ---- Day15.cs | 224 -------- Day16.cs | 64 --- Day17.cs | 54 -- Program.cs | 32 -- README.md | 10 - aoc2019.csproj | 14 - aoc2019.sln | 16 +- aoc2019.test/Tests.cs | 56 ++ aoc2019.test/aoc2019.test.csproj | 20 + aoc2019/Day.cs | 49 ++ aoc2019/Day01.cs | 43 ++ aoc2019/Day02.cs | 46 ++ aoc2019/Day03.cs | 57 ++ aoc2019/Day04.cs | 49 ++ aoc2019/Day05.cs | 78 +++ aoc2019/Day06.cs | 38 ++ aoc2019/Day07.cs | 67 +++ aoc2019/Day08.cs | 38 ++ aoc2019/Day09.cs | 29 + aoc2019/Day10.cs | 73 +++ aoc2019/Day11.cs | 112 ++++ aoc2019/Day12.cs | 127 +++++ aoc2019/Day13.cs | 87 +++ aoc2019/Day14.cs | 110 ++++ aoc2019/Day15.cs | 224 ++++++++ aoc2019/Day16.cs | 64 +++ aoc2019/Day17.cs | 54 ++ aoc2019/Program.cs | 32 ++ aoc2019/README.md | 10 + aoc2019/aoc2019.csproj | 14 + aoc2019/input/day01.in | 100 ++++ aoc2019/input/day02.in | 1 + aoc2019/input/day03.in | 2 + aoc2019/input/day04.in | 1 + aoc2019/input/day05.in | 1 + aoc2019/input/day06.in | 1110 ++++++++++++++++++++++++++++++++++++++ aoc2019/input/day07.in | 1 + aoc2019/input/day08.in | 1 + aoc2019/input/day09.in | 1 + aoc2019/input/day10.in | 24 + aoc2019/input/day11.in | 1 + aoc2019/input/day12.in | 4 + aoc2019/input/day13.in | 1 + aoc2019/input/day14.in | 61 +++ aoc2019/input/day15.in | 1 + aoc2019/input/day16.in | 1 + aoc2019/input/day17.in | 1 + aoc2019/input/day18.in | 81 +++ aoc2019/input/day19.in | 1 + aoc2019/input/day20.in | 119 ++++ aoc2019/input/day21.in | 1 + aoc2019/input/day22.in | 100 ++++ aoc2019/input/day23.in | 1 + aoc2019/input/day24.in | 5 + aoc2019/input/day25.in | 1 + aoc2019/lib/Extensions.cs | 48 ++ aoc2019/lib/IntCodeVM.cs | 160 ++++++ input/day01.in | 100 ---- input/day02.in | 1 - input/day03.in | 2 - input/day04.in | 1 - input/day05.in | 1 - input/day06.in | 1110 -------------------------------------- input/day07.in | 1 - input/day08.in | 1 - input/day09.in | 1 - input/day10.in | 24 - input/day11.in | 1 - input/day12.in | 4 - input/day13.in | 1 - input/day14.in | 61 --- input/day15.in | 1 - input/day16.in | 1 - input/day17.in | 1 - input/day18.in | 81 --- input/day19.in | 1 - input/day20.in | 119 ---- input/day21.in | 1 - input/day22.in | 100 ---- input/day23.in | 1 - input/day24.in | 5 - input/day25.in | 1 - lib/Extensions.cs | 48 -- lib/IntCodeVM.cs | 160 ------ 100 files changed, 3322 insertions(+), 3239 deletions(-) delete mode 100644 Day.cs delete mode 100644 Day01.cs delete mode 100644 Day02.cs delete mode 100644 Day03.cs delete mode 100644 Day04.cs delete mode 100644 Day05.cs delete mode 100644 Day06.cs delete mode 100644 Day07.cs delete mode 100644 Day08.cs delete mode 100644 Day09.cs delete mode 100644 Day10.cs delete mode 100644 Day11.cs delete mode 100644 Day12.cs delete mode 100644 Day13.cs delete mode 100644 Day14.cs delete mode 100644 Day15.cs delete mode 100644 Day16.cs delete mode 100644 Day17.cs delete mode 100644 Program.cs delete mode 100644 README.md delete mode 100644 aoc2019.csproj create mode 100644 aoc2019.test/Tests.cs create mode 100644 aoc2019.test/aoc2019.test.csproj create mode 100644 aoc2019/Day.cs create mode 100644 aoc2019/Day01.cs create mode 100644 aoc2019/Day02.cs create mode 100644 aoc2019/Day03.cs create mode 100644 aoc2019/Day04.cs create mode 100644 aoc2019/Day05.cs create mode 100644 aoc2019/Day06.cs create mode 100644 aoc2019/Day07.cs create mode 100644 aoc2019/Day08.cs create mode 100644 aoc2019/Day09.cs create mode 100644 aoc2019/Day10.cs create mode 100644 aoc2019/Day11.cs create mode 100644 aoc2019/Day12.cs create mode 100644 aoc2019/Day13.cs create mode 100644 aoc2019/Day14.cs create mode 100644 aoc2019/Day15.cs create mode 100644 aoc2019/Day16.cs create mode 100644 aoc2019/Day17.cs create mode 100644 aoc2019/Program.cs create mode 100644 aoc2019/README.md create mode 100644 aoc2019/aoc2019.csproj create mode 100644 aoc2019/input/day01.in create mode 100644 aoc2019/input/day02.in create mode 100644 aoc2019/input/day03.in create mode 100644 aoc2019/input/day04.in create mode 100644 aoc2019/input/day05.in create mode 100644 aoc2019/input/day06.in create mode 100644 aoc2019/input/day07.in create mode 100644 aoc2019/input/day08.in create mode 100644 aoc2019/input/day09.in create mode 100644 aoc2019/input/day10.in create mode 100644 aoc2019/input/day11.in create mode 100644 aoc2019/input/day12.in create mode 100644 aoc2019/input/day13.in create mode 100644 aoc2019/input/day14.in create mode 100644 aoc2019/input/day15.in create mode 100644 aoc2019/input/day16.in create mode 100644 aoc2019/input/day17.in create mode 100644 aoc2019/input/day18.in create mode 100644 aoc2019/input/day19.in create mode 100644 aoc2019/input/day20.in create mode 100644 aoc2019/input/day21.in create mode 100644 aoc2019/input/day22.in create mode 100644 aoc2019/input/day23.in create mode 100644 aoc2019/input/day24.in create mode 100644 aoc2019/input/day25.in create mode 100644 aoc2019/lib/Extensions.cs create mode 100644 aoc2019/lib/IntCodeVM.cs delete mode 100644 input/day01.in delete mode 100644 input/day02.in delete mode 100644 input/day03.in delete mode 100644 input/day04.in delete mode 100644 input/day05.in delete mode 100644 input/day06.in delete mode 100644 input/day07.in delete mode 100644 input/day08.in delete mode 100644 input/day09.in delete mode 100644 input/day10.in delete mode 100644 input/day11.in delete mode 100644 input/day12.in delete mode 100644 input/day13.in delete mode 100644 input/day14.in delete mode 100644 input/day15.in delete mode 100644 input/day16.in delete mode 100644 input/day17.in delete mode 100644 input/day18.in delete mode 100644 input/day19.in delete mode 100644 input/day20.in delete mode 100644 input/day21.in delete mode 100644 input/day22.in delete mode 100644 input/day23.in delete mode 100644 input/day24.in delete mode 100644 input/day25.in delete mode 100644 lib/Extensions.cs delete mode 100644 lib/IntCodeVM.cs diff --git a/.drone.yml b/.drone.yml index 42c62bb..09bd08f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,7 +3,8 @@ kind: pipeline name: run steps: - - name: run - image: mcr.microsoft.com/dotnet/sdk:latest - commands: - - dotnet run + - name: run + image: mcr.microsoft.com/dotnet/sdk:latest + commands: + - dotnet test + - dotnet run --project aoc2019/aoc2019.csproj diff --git a/Day.cs b/Day.cs deleted file mode 100644 index eb3ef49..0000000 --- a/Day.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using aoc2019.lib; - -namespace aoc2019 -{ - public abstract class Day - { - protected Day(int dayNumber, string puzzleName) - { - DayNumber = dayNumber; - PuzzleName = puzzleName; - } - - public int DayNumber { get; } - public string PuzzleName { get; } - - protected virtual IEnumerable Input => - File.ReadLines(FileName); - - protected string FileName => - Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"input/day{DayNumber,2:00}.in"); - - public void AllParts(bool verbose = true) - { - Console.WriteLine($"Day {DayNumber,2}: {PuzzleName}"); - var s = Stopwatch.StartNew(); - var part1 = Part1(); - s.Stop(); - Console.Write($"Part1: {part1,-15} "); - Console.WriteLine(verbose ? $"{s.ScaleMilliseconds()}ms elapsed" : ""); - - s.Reset(); - - s.Start(); - var part2 = Part2(); - s.Stop(); - Console.Write($"Part2: {part2,-15} "); - Console.WriteLine(verbose ? $"{s.ScaleMilliseconds()}ms elapsed" : ""); - - Console.WriteLine(); - } - - protected abstract string Part1(); - protected abstract string Part2(); - } -} \ No newline at end of file diff --git a/Day01.cs b/Day01.cs deleted file mode 100644 index d991917..0000000 --- a/Day01.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.Collections.Generic; -using System.Linq; - -namespace aoc2019 -{ - internal sealed class Day01 : Day - { - private readonly IEnumerable masses; - - public Day01() : base(1, "The Tyranny of the Rocket Equation") - { - masses = Input.Select(int.Parse); - } - - private static int FuelCost(int weight) - { - return weight / 3 - 2; - } - - private static int FullCost(int cost) - { - int total = 0, newcost, tmp = cost; - - while ((newcost = FuelCost(tmp)) >= 0) - { - total += newcost; - tmp = newcost; - } - - return total; - } - - protected override string Part1() - { - return $"{masses.Sum(FuelCost)}"; - } - - protected override string Part2() - { - return $"{masses.Sum(FullCost)}"; - } - } -} \ No newline at end of file diff --git a/Day02.cs b/Day02.cs deleted file mode 100644 index 3a79970..0000000 --- a/Day02.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.Collections.Generic; -using System.Linq; - -namespace aoc2019 -{ - internal sealed class Day02 : Day - { - private readonly IEnumerable input; - - public Day02() : base(2, "1202 Program Alarm") - { - input = Input.First().Split(',').Select(int.Parse); - } - - public int RunIntCode(int noun, int verb) - { - var v = input.ToList(); - v[1] = noun; - v[2] = verb; - - for (var i = 0; v[i] != 99; i += 4) - v[v[i + 3]] = v[i] switch - { - 1 => v[v[i + 1]] + v[v[i + 2]], - 2 => v[v[i + 1]] * v[v[i + 2]] - }; - - return v[0]; - } - - protected override string Part1() - { - return $"{RunIntCode(12, 2)}"; - } - - protected override string Part2() - { - for (var i = 0; i < 100; i++) - for (var j = 0; j < 100; j++) - if (RunIntCode(i, j) == 19690720) - return $"{100 * i + j}"; - - return string.Empty; - } - } -} \ No newline at end of file diff --git a/Day03.cs b/Day03.cs deleted file mode 100644 index e339c27..0000000 --- a/Day03.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace aoc2019 -{ - internal sealed class Day03 : Day - { - private readonly IEnumerable<(int, int)> intersections; - private readonly List> wires; - - public Day03() : base(3, "Crossed Wires") - { - wires = Input.Select(ParseWire).ToList(); - intersections = wires[0].Keys.Intersect(wires[1].Keys); - } - - protected override string Part1() - { - return $"{intersections.Min(x => Math.Abs(x.Item1) + Math.Abs(x.Item2))}"; - } - - protected override string Part2() - { - // add 2 to count (0, 0) on both lines - return $"{intersections.Min(x => wires[0][x] + wires[1][x]) + 2}"; - } - - private static Dictionary<(int, int), int> ParseWire(string line) - { - var r = new Dictionary<(int, int), int>(); - int x = 0, y = 0, c = 0, i; - - foreach (var step in line.Split(',')) - { - var d = int.Parse(step.Substring(1)); - switch (step[0]) - { - case 'U': - for (i = 0; i < d; i++) r.TryAdd((x, ++y), c++); - break; - case 'D': - for (i = 0; i < d; i++) r.TryAdd((x, --y), c++); - break; - case 'R': - for (i = 0; i < d; i++) r.TryAdd((++x, y), c++); - break; - case 'L': - for (i = 0; i < d; i++) r.TryAdd((--x, y), c++); - break; - } - } - - return r; - } - } -} \ No newline at end of file diff --git a/Day04.cs b/Day04.cs deleted file mode 100644 index f4ddcf9..0000000 --- a/Day04.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.Linq; - -namespace aoc2019 -{ - internal sealed class Day04 : Day - { - private readonly int end; - - private readonly int start; - - public Day04() : base(4, "Secure Container") - { - var range = Input.First().Split('-').Select(int.Parse).ToList(); - start = range[0]; - end = range[1]; - } - - private bool IsValid(int i) - { - var prev = 0; - var hasDup = false; - foreach (var c in i.ToString()) - { - var curr = c - '0'; - if (curr < prev) return false; - if (curr == prev) hasDup = true; - prev = curr; - } - - return i >= start && i <= end && hasDup; - } - - private bool HasOnePair(int i) - { - var s = i.ToString(); - return IsValid(i) && s.Select(c => s.Count(j => j == c)).Any(c => c == 2); - } - - protected override string Part1() - { - return $"{Enumerable.Range(start, end).Count(IsValid)}"; - } - - protected override string Part2() - { - return $"{Enumerable.Range(start, end).Count(HasOnePair)}"; - } - } -} \ No newline at end of file diff --git a/Day05.cs b/Day05.cs deleted file mode 100644 index 763d0f8..0000000 --- a/Day05.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System.Collections.Generic; -using System.Linq; - -namespace aoc2019 -{ - internal sealed class Day05 : Day - { - private readonly IEnumerable tape; - - private int output; - - public Day05() : base(5, "Sunny with a Chance of Asteroids") - { - tape = Input.First().Split(',').Select(int.Parse); - } - - public void RunIntCode(List v, int input) - { - var i = 0; - while (i < v.Count && v[i] != 99) - { - int Val(int mode, int val) - { - return mode != 0 ? val : v[val]; - } - - var mode1 = v[i] / 100 % 10; - var mode2 = v[i] / 1000; - - switch (v[i] % 100) - { - case 1: - v[v[i + 3]] = Val(mode1, v[i + 1]) + Val(mode2, v[i + 2]); - i += 4; - break; - case 2: - v[v[i + 3]] = Val(mode1, v[i + 1]) * Val(mode2, v[i + 2]); - i += 4; - break; - case 3: - v[v[i + 1]] = input; - i += 2; - break; - case 4: - output = Val(mode1, v[i + 1]); - i += 2; - break; - case 5: - i = Val(mode1, v[i + 1]) == 0 ? i + 3 : Val(mode2, v[i + 2]); - break; - case 6: - i = Val(mode1, v[i + 1]) != 0 ? i + 3 : Val(mode2, v[i + 2]); - break; - case 7: - v[v[i + 3]] = Val(mode1, v[i + 1]) < Val(mode2, v[i + 2]) ? 1 : 0; - i += 4; - break; - case 8: - v[v[i + 3]] = Val(mode1, v[i + 1]) == Val(mode2, v[i + 2]) ? 1 : 0; - i += 4; - break; - } - } - } - - protected override string Part1() - { - RunIntCode(tape.ToList(), 1); - return $"{output}"; - } - - protected override string Part2() - { - RunIntCode(tape.ToList(), 5); - return $"{output}"; - } - } -} \ No newline at end of file diff --git a/Day06.cs b/Day06.cs deleted file mode 100644 index 7ef3d0a..0000000 --- a/Day06.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.Collections.Generic; -using System.Linq; - -namespace aoc2019 -{ - internal sealed class Day06 : Day - { - private readonly Dictionary input; - - public Day06() : base(6, "Universal Orbit Map") - { - input = Input.ToDictionary(i => i.Split(')')[1], i => i.Split(')')[0]); - } - - private List GetParents(string obj) - { - var res = new List(); - for (var curr = obj; curr != "COM"; curr = input[curr]) - res.Add(curr); - res.Add("COM"); - return res; - } - - protected override string Part1() - { - return $"{input.Keys.Sum(o => GetParents(o).Count - 1)}"; - } - - protected override string Part2() - { - var you = GetParents("YOU"); - var san = GetParents("SAN"); - var common = 1; - for (; you[^common] == san[^common]; common++) ; - return $"{you.Count + san.Count - common * 2}"; - } - } -} \ No newline at end of file diff --git a/Day07.cs b/Day07.cs deleted file mode 100644 index f26b8a6..0000000 --- a/Day07.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using aoc2019.lib; - -namespace aoc2019 -{ - internal sealed class Day07 : Day - { - private readonly IntCodeVM[] Amplifiers = new IntCodeVM[5]; - - public Day07() : base(7, "Amplification Circuit") - { - for (var i = 0; i < 5; i++) Amplifiers[i] = new IntCodeVM(Input.First()); - } - - protected override string Part1() - { - long i, largest = 0; - - foreach (var phaseSeq in Enumerable.Range(0, 5).Permute()) - { - i = 0; - foreach (var (vm, phase) in Amplifiers.Zip(phaseSeq)) - { - vm.Reset(); - vm.Run(phase, i); - i = vm.Result; - } - - if (i > largest) - largest = i; - } - - return $"{largest}"; - } - - protected override string Part2() - { - long i, largest = 0; - - foreach (var phaseSeq in Enumerable.Range(5, 5).Permute()) - { - i = 0; - foreach (var (vm, phase) in Amplifiers.Zip(phaseSeq)) - { - vm.Reset(); - vm.AddInput(phase); - } - - var vms = new Queue(Amplifiers); - while (vms.Count > 0) - { - var vm = vms.Dequeue(); - var haltType = vm.Run(i); - if (haltType == IntCodeVM.HaltType.Waiting) - vms.Enqueue(vm); - i = vm.Result; - } - - if (i > largest) - largest = i; - } - - return $"{largest}"; - } - } -} \ No newline at end of file diff --git a/Day08.cs b/Day08.cs deleted file mode 100644 index 94cd461..0000000 --- a/Day08.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using aoc2019.lib; - -namespace aoc2019 -{ - internal sealed class Day08 : Day - { - private readonly List> photo; - - public Day08() : base(8, "Space Image Format") - { - photo = Input.First().Chunk(25 * 6).Select(s => s.ToList()).ToList(); - } - - protected override string Part1() - { - var l = photo.OrderBy(layer => layer.Count(pixel => pixel == '0')).First(); - return $"{l.Count(p => p == '1') * l.Count(p => p == '2')}"; - } - - protected override string Part2() - { - return Enumerable.Range(0, 25 * 6) - .Select(p => Enumerable.Range(0, photo.Count) - .Select(l => photo[l][p]) - .Aggregate('2', (acc, next) => - acc != '2' ? acc : next == '0' ? ' ' : next - ) - ) - .ToDelimitedString() - .Chunk(25) - .ToDelimitedString(Environment.NewLine) - .Replace('1', 'x'); - } - } -} \ No newline at end of file diff --git a/Day09.cs b/Day09.cs deleted file mode 100644 index 0f45dfd..0000000 --- a/Day09.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Linq; -using aoc2019.lib; - -namespace aoc2019 -{ - internal sealed class Day09 : Day - { - private readonly IntCodeVM vm; - - public Day09() : base(9, "Sensor Boost") - { - vm = new IntCodeVM(Input.First()); - } - - protected override string Part1() - { - vm.Reset(); - vm.Run(1); - return $"{vm.output.ToDelimitedString(",")}"; - } - - protected override string Part2() - { - vm.Reset(); - vm.Run(2); - return $"{vm.output.ToDelimitedString(",")}"; - } - } -} \ No newline at end of file diff --git a/Day10.cs b/Day10.cs deleted file mode 100644 index 376e427..0000000 --- a/Day10.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using aoc2019.lib; - -namespace aoc2019 -{ - internal sealed class Day10 : Day - { - private readonly HashSet<(int x, int y)> asteroids; - private (int x, int y) best = (x: -1, y: -1); - private int bestCanSee; - - public Day10() : base(10, "Monitoring Station") - { - asteroids = Input - .Select((r, y) => r.Select((c, x) => (x, y, isAsteroid: c == '#')).ToArray()) - .SelectMany(r => r) - .Where(a => a.isAsteroid) - .Select(a => (a.x, a.y)) - .ToHashSet(); - } - - protected override string Part1() - { - foreach (var asteroid in asteroids) - { - var canSee = asteroids - .Except(new[] {asteroid}) - .Select(a => (x: a.x - asteroid.x, y: a.y - asteroid.y)) - .GroupBy(a => Math.Atan2(a.y, a.x)) - .Count(); - - if (canSee > bestCanSee) - { - best = asteroid; - bestCanSee = canSee; - } - } - - return $"{bestCanSee}"; - } - - protected override string Part2() - { - static IEnumerable<(int x, int y, double angle, double dist)> GetValue( - Queue<(int x, int y, double angle, double dist)> q) - { - if (q.Count > 0) yield return q.Dequeue(); - } - - return asteroids - .Where(a => a != best) - .Select(a => - { - var xDist = a.x - best.x; - var yDist = a.y - best.y; - var angle = Math.Atan2(xDist, yDist); - return (a.x, a.y, angle, dist: Math.Sqrt(xDist * xDist + yDist * yDist)); - }) - .ToLookup(a => a.angle) - .OrderByDescending(a => a.Key) - .Select(a => new Queue<(int x, int y, double angle, double dist)>(a.OrderBy(b => b.dist))) - .Repeat() - .SelectMany(GetValue) - .Skip(199) - .Take(1) - .Select(a => a.x * 100 + a.y) - .Single() - .ToString(); - } - } -} \ No newline at end of file diff --git a/Day11.cs b/Day11.cs deleted file mode 100644 index e45f6ce..0000000 --- a/Day11.cs +++ /dev/null @@ -1,112 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using aoc2019.lib; - -namespace aoc2019 -{ - internal sealed class Day11 : Day - { - private readonly IntCodeVM vm; - private Direction heading; - private long x, y; - - public Day11() : base(11, "Space Police") - { - vm = new IntCodeVM(Input.First()); - } - - private void Move() - { - switch (heading) - { - case Direction.Up: - y++; - break; - case Direction.Down: - y--; - break; - case Direction.Left: - x--; - break; - case Direction.Right: - x++; - break; - } - - ; - } - - private void Turn(long direction) - { - switch (heading) - { - case Direction.Up: - heading = direction == 0 ? Direction.Left : Direction.Right; - break; - case Direction.Down: - heading = direction == 0 ? Direction.Right : Direction.Left; - break; - case Direction.Left: - heading = direction == 0 ? Direction.Down : Direction.Up; - break; - case Direction.Right: - heading = direction == 0 ? Direction.Up : Direction.Down; - break; - } - - Move(); - } - - private Dictionary<(long x, long y), long> PaintShip(int initialVal) - { - var map = new Dictionary<(long, long), long>(); - vm.Reset(); - heading = Direction.Up; - x = 0; - y = 0; - map[(x, y)] = initialVal; - - var haltType = IntCodeVM.HaltType.Waiting; - while (haltType == IntCodeVM.HaltType.Waiting) - { - haltType = vm.Run(map.GetValueOrDefault((x, y))); - map[(x, y)] = vm.Result; - Turn(vm.Result); - } - - return map; - } - - protected override string Part1() - { - return $"{PaintShip(0).Count}"; - } - - protected override string Part2() - { - var map = PaintShip(1); - var minX = (int) map.Keys.Select(x => x.x).Min(); - var maxX = (int) map.Keys.Select(x => x.x).Max(); - var minY = (int) map.Keys.Select(x => x.y).Min(); - var maxY = (int) map.Keys.Select(x => x.y).Max(); - - return Enumerable.Range(minY, maxY - minY + 1) - .Select(y => - Enumerable.Range(minX, maxX - minX + 1) - .Select(x => map.GetValueOrDefault((x, y)) == 0 ? ' ' : '#') - .ToDelimitedString() - ) - .Reverse() - .ToDelimitedString(Environment.NewLine); - } - - private enum Direction - { - Up, - Down, - Left, - Right - } - } -} \ No newline at end of file diff --git a/Day12.cs b/Day12.cs deleted file mode 100644 index 312c705..0000000 --- a/Day12.cs +++ /dev/null @@ -1,127 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace aoc2019 -{ - internal sealed class Day12 : Day - { - private readonly List moons; - private int step; - - public Day12() : base(12, "The N-Body Problem") - { - moons = Input - .Select(moon => - moon - .TrimStart('<') - .TrimEnd('>') - .Split(",") - .Select(val => int.Parse(val.Split("=").Last())) - ) - .Select(moon => new Position(moon.ToList())) - .ToList(); - - foreach (var moon in moons) - moon.SetSiblings(moons); - } - - public static long LCM(long a, long b) - { - return a * b / GCD(a, b); - } - - public static long GCD(long a, long b) - { - if (b == 0) return a; - return GCD(b, a % b); - } - - private void Step() - { - foreach (var moon in moons) - moon.Gravitate(); - - foreach (var moon in moons) - moon.Move(); - - step++; - } - - protected override string Part1() - { - while (step < 1000) - Step(); - - return $"{moons.Sum(p => p.TotalEnergy)}"; - } - - protected override string Part2() - { - int cycleX = 0, cycleY = 0, cycleZ = 0; - - while (cycleX == 0 || cycleY == 0 || cycleZ == 0) - { - Step(); - if (cycleX == 0 && moons.All(m => m.dx == 0)) cycleX = step * 2; - if (cycleY == 0 && moons.All(m => m.dy == 0)) cycleY = step * 2; - if (cycleZ == 0 && moons.All(m => m.dz == 0)) cycleZ = step * 2; - } - - return $"{LCM(cycleX, LCM(cycleY, cycleZ))}"; - } - - public class Position - { - public int dx, dy, dz; - private List siblings; - public int x, y, z; - - public Position(IList moon) - { - x = moon[0]; - y = moon[1]; - z = moon[2]; - dx = 0; - dy = 0; - dz = 0; - } - - internal int KineticEnergy => - Math.Abs(x) + Math.Abs(y) + Math.Abs(z); - - internal int PotentialEnergy => - Math.Abs(dx) + Math.Abs(dy) + Math.Abs(dz); - - internal int TotalEnergy => - KineticEnergy * PotentialEnergy; - - public void SetSiblings(List positions) - { - siblings = positions.Where(p => p != this).ToList(); - } - - public override string ToString() - { - return $"pos= vel="; - } - - internal void Gravitate() - { - foreach (var m in siblings) - { - if (x != m.x) dx += x > m.x ? -1 : 1; - if (y != m.y) dy += y > m.y ? -1 : 1; - if (z != m.z) dz += z > m.z ? -1 : 1; - } - } - - internal void Move() - { - x += dx; - y += dy; - z += dz; - } - } - } -} \ No newline at end of file diff --git a/Day13.cs b/Day13.cs deleted file mode 100644 index 4dff712..0000000 --- a/Day13.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using aoc2019.lib; - -namespace aoc2019 -{ - internal sealed class Day13 : Day - { - private readonly Dictionary<(int x, int y), int> board; - - private readonly IntCodeVM vm; - - public Day13() : base(13, "Care Package") - { - vm = new IntCodeVM(Input.First()); - board = new Dictionary<(int, int), int>(); - } - - private void UpdateTiles(IEnumerable queue) - { - var input = queue.Select(i => (int) i).ToList(); - - for (var i = 0; i < input.Count - 2; i += 3) - { - var x = input[i]; - var y = input[i + 1]; - var val = input[i + 2]; - - if (board.ContainsKey((x, y))) - board[(x, y)] = val; - else - board.Add((x, y), val); - } - } - - private void PrintBoard() - { - foreach (var ((x, y), value) in board) - { - if (x < 0 || y < 0) continue; - Console.SetCursorPosition(x, y); - Console.Write(value switch - { - 0 => " ", - 1 => "|", - 2 => "B", - 3 => "_", - 4 => ".", - _ => value - }); - } - } - - protected override string Part1() - { - vm.Reset(); - vm.Run(); - return $"{vm.output.Where((v, i) => (i + 1) % 3 == 0 && v == 2).Count()}"; - } - - protected override string Part2() - { - vm.Reset(); - vm.memory[0] = 2; - var printBoard = false; - var gameTicks = 0; - if (printBoard) Console.Clear(); - - var haltType = IntCodeVM.HaltType.Waiting; - while (haltType == IntCodeVM.HaltType.Waiting) - { - haltType = vm.Run(); - UpdateTiles(vm.output); - - var (ball, _) = board.First(t => t.Value == 4).Key; - var (paddle, _) = board.First(t => t.Value == 3).Key; - vm.AddInput(ball > paddle ? 1 : ball < paddle ? -1 : 0); - - gameTicks++; - if (printBoard) PrintBoard(); - } - - return $"after {gameTicks} moves, the score is: {board[(-1, 0)]}"; - } - } -} \ No newline at end of file diff --git a/Day14.cs b/Day14.cs deleted file mode 100644 index a73a858..0000000 --- a/Day14.cs +++ /dev/null @@ -1,110 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace aoc2019 -{ - internal sealed class Day14 : Day - { - private readonly Dictionary reactions; - - private Dictionary available; - - public Day14() : base(14, "Space Stoichiometry") - { - reactions = Input - .Select(Reaction.Parse) - .ToDictionary(r => r.product.Name); - } - - private bool Consume(string chem, long quantity) - { - if (quantity <= 0) - throw new ArgumentOutOfRangeException(nameof(quantity)); - - if (!available.ContainsKey(chem)) - available[chem] = 0; - - if (available[chem] < quantity && !Produce(chem, quantity - available[chem])) - return false; - - available[chem] -= quantity; - return true; - } - - private bool Produce(string chem, long quantity) - { - if (chem == "ORE") - return false; - - var reaction = reactions[chem]; - var reactionCount = (long) Math.Ceiling((double) quantity / reaction.product.Quantity); - - foreach (var reactant in reaction.reactants) - if (!Consume(reactant.Name, reactionCount * reactant.Quantity)) - return false; - - available[chem] = available.GetValueOrDefault(chem) + reactionCount * reaction.product.Quantity; - return true; - } - - protected override string Part1() - { - available = new Dictionary {{"ORE", long.MaxValue}}; - Consume("FUEL", 1); - return $"{long.MaxValue - available["ORE"]}"; - } - - protected override string Part2() - { - const long capacity = 1_000_000_000_000; - available = new Dictionary {{"ORE", capacity}}; - Consume("FUEL", 1); - - var oreConsumed = capacity - available["ORE"]; - while (Produce("FUEL", Math.Max(1, available["ORE"] / oreConsumed))) - { - } - - return $"{available["FUEL"] + 1}"; - } - - private struct Component - { - public string Name { get; set; } - public int Quantity { get; set; } - } - - private class Reaction - { - public readonly Component product; - public readonly Component[] reactants; - - private Reaction(Component[] reactants, Component product) - { - this.reactants = reactants; - this.product = product; - } - - public static Reaction Parse(string s) - { - var ss = s.Split(new[] {", ", " => "}, StringSplitOptions.None); - - return new Reaction( - ss.Take(ss.Length - 1).Select(ParseComponent).ToArray(), - ParseComponent(ss[^1]) - ); - - static Component ParseComponent(string s) - { - var spl = s.Split(' ', 2); - return new Component - { - Quantity = int.Parse(spl[0]), - Name = spl[1] - }; - } - } - } - } -} \ No newline at end of file diff --git a/Day15.cs b/Day15.cs deleted file mode 100644 index 0b2ca88..0000000 --- a/Day15.cs +++ /dev/null @@ -1,224 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using aoc2019.lib; - -namespace aoc2019 -{ - internal sealed class Day15 : Day - { - private readonly bool verbose = false; - private readonly IntCodeVM vm; - - public Day15() : base(15, "Oxygen System") - { - vm = new IntCodeVM(Input.First()); - } - - protected override string Part1() - { - vm.Reset(); - var currentLocation = new Location(0, 0); - var halt = IntCodeVM.HaltType.Waiting; - while (halt == IntCodeVM.HaltType.Waiting) - { - var direction = currentLocation.NextDirection(); - if (direction <= 4) - { - var (x, y) = currentLocation.Neighbor(direction); - if (Location.GetLocation(x, y) == null) - { - halt = vm.Run(direction); - switch (vm.Result) - { - case Location.Wall: - new Location(x, y, Location.Opposites[direction], Location.Wall); - break; - case Location.Empty: - currentLocation = new Location(x, y, Location.Opposites[direction]); - break; - case Location.System: - currentLocation = new Location(x, y, Location.Opposites[direction], Location.System); - break; - default: - throw new Exception($"Unknown IntCodeVM response: {vm.Result}"); - } - } - } - else - { - direction = currentLocation.PreviousDirection; - if (direction > 0) - { - halt = vm.Run(direction); - switch (vm.Result) - { - case Location.Empty: - case Location.System: - currentLocation = Location.GetLocation(currentLocation.Neighbor(direction)); - break; - default: - throw new Exception($"Unknown or unexpected response for previous room: {vm.Result}"); - } - } - else - { - if (verbose) - { - // find extents of canvas - int xMin, xMax, yMin, yMax; - xMin = yMin = int.MaxValue; - xMax = yMax = int.MinValue; - foreach (var (x, y) in Location.AllLocations.Keys) - { - if (x < xMin) xMin = x; - if (x > xMax) xMax = x; - if (y < yMin) yMin = y; - if (y > yMax) yMax = y; - } - - Console.WriteLine($"Canvas extends from ({xMin}, {yMin}) to ({xMax}, {yMax})"); - - // print board - for (var y = yMin; y <= yMax; y++) - { - var line = ""; - for (var x = xMin; x <= xMax; x++) - if (Location.AllLocations.ContainsKey((x, y))) - line += Location.AllLocations[(x, y)].Image(); - else - line += "@"; - - Console.WriteLine(line); - } - } - - currentLocation = Location.OxygenLocation; - var distance = 0; - while (currentLocation.PreviousDirection != 0) - { - distance++; - currentLocation = Location.GetLocation(currentLocation.PreviousLocation()); - } - - return $"{distance}"; - } - } - } - - return ""; - } - - protected override string Part2() - { - var changed = true; - while (changed) - { - changed = false; - foreach (var location in Location.AllLocations.Values) - changed = location.UpdateDistanceToOxygenSystem() || changed; - } - - return Location.AllLocations.Values - .Where(l => !l.IsWall) - .Max(l => l.DistanceToOxygenSystem) - .ToString(); - } - - private class Location - { - public const int Wall = 0; - public const int Empty = 1; - public const int System = 2; - - private static readonly int[] Dx = {0, 0, 0, 1, -1}; - private static readonly int[] Dy = {0, 1, -1, 0, 0}; - public static readonly int[] Opposites = {0, 2, 1, 4, 3}; - - public static readonly Dictionary<(int x, int y), Location> - AllLocations = new Dictionary<(int x, int y), Location>(); - - private readonly int currentType; - public int DistanceToOxygenSystem = int.MaxValue - 1; - - private int searchDirection = 1; - - public Location(int x, int y, int prev = 0, int type = Empty) - { - PreviousDirection = prev; - currentType = type; - X = x; - Y = y; - - if (type == System) - { - OxygenLocation = this; - DistanceToOxygenSystem = 0; - // Console.WriteLine($"Found Oxygen System at ({x}, {y})"); - } - - AllLocations.Add((x, y), this); - } - - public static Location OxygenLocation { get; private set; } - public int PreviousDirection { get; } - private int X { get; } - private int Y { get; } - - public bool IsWall => currentType == Wall; - - public string Image() - { - return currentType switch - { - Wall => "\u2587", - Empty => X == 0 && Y == 0 ? "S" : " ", - System => "O", - _ => "?" - }; - } - - public bool UpdateDistanceToOxygenSystem() - { - if (currentType != Empty) return false; - - foreach (var direction in Enumerable.Range(1, 4)) - { - var distance = GetLocation(Neighbor(direction))?.DistanceToOxygenSystem ?? int.MaxValue; - if (distance + 1 < DistanceToOxygenSystem) - { - DistanceToOxygenSystem = distance + 1; - return true; - } - } - - return false; - } - - public (int, int) Neighbor(int direction) - { - return (X + Dx[direction], Y + Dy[direction]); - } - - public (int, int) PreviousLocation() - { - return Neighbor(PreviousDirection); - } - - public int NextDirection() - { - return searchDirection++; - } - - public static Location GetLocation(int x, int y) - { - return AllLocations.ContainsKey((x, y)) ? AllLocations[(x, y)] : null; - } - - public static Location GetLocation((int x, int y) coords) - { - return GetLocation(coords.x, coords.y); - } - } - } -} \ No newline at end of file diff --git a/Day16.cs b/Day16.cs deleted file mode 100644 index e2958bd..0000000 --- a/Day16.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using aoc2019.lib; - -namespace aoc2019 -{ - internal sealed class Day16 : Day - { - private static readonly int[] BasePattern = {0, 1, 0, -1}; - private readonly int[] initialList; - - public Day16() : base(16, "Flawed Frequency Transmission") - { - initialList = Input.First().Select(c => int.Parse($"{c}")).ToArray(); - } - - protected override string Part1() - { - const int phaseCount = 100; - var signal0 = initialList.ToArray(); - var signal1 = new int[signal0.Length]; - - for (var i = 0; i < phaseCount; i++) - CalculateSignal(i % 2 == 0 ? signal0 : signal1, i % 2 == 0 ? signal1 : signal0); - - return new string( - signal0.Take(8).Select(c => (char) (c + '0')) - .ToArray()); - } - - protected override string Part2() - { - const int phaseCount = 100; - var messageOffset = initialList.Take(7).Aggregate((n, i) => n * 10 + i); - var signal = initialList.Repeat(10_000).Skip(messageOffset).ToArray(); - - for (var p = 0; p < phaseCount; p++) - { - signal[^1] %= 10; - for (var i = signal.Length - 2; i >= 0; i--) - signal[i] = (signal[i + 1] + signal[i]) % 10; - } - - return new string(signal.Take(8).Select(c => (char) (c + '0')).ToArray()); - } - - private static void CalculateSignal(IReadOnlyList input, IList output) - { - for (var outputIndex = 0; outputIndex < output.Count; outputIndex++) - output[outputIndex] = - Math.Abs(PatternValues(outputIndex, input.Count).Select((pv, i) => pv * input[i] % 10).Sum()) % 10; - } - - private static IEnumerable PatternValues(int index, int count) - { - return BasePattern - .SelectMany(v => Enumerable.Repeat(v, index + 1)) - .Repeat(int.MaxValue) - .Skip(1) - .Take(count); - } - } -} \ No newline at end of file diff --git a/Day17.cs b/Day17.cs deleted file mode 100644 index 2438ee9..0000000 --- a/Day17.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Linq; -using System.Text; -using aoc2019.lib; - -namespace aoc2019 -{ - internal sealed class Day17 : Day - { - private const bool Verbose = false; - - private readonly IntCodeVM vm; - - public Day17() : base(17, "Set and Forget") - { - vm = new IntCodeVM(Input.First()); - } - - protected override string Part1() - { - vm.Reset(); - vm.Run(); - var sb = new StringBuilder(); - while (vm.output.Any()) - sb.Append((char) vm.Result); - if (Verbose) Console.Write(sb); - var grid = sb.ToString().Trim().Split().Select(s => s.ToCharArray()).ToArray(); - - var sum = 0; - for (var y = 1; y < grid.Length - 1; y++) - for (var x = 1; x < grid[y].Length - 1; x++) - if (grid[y][x] == '#' && - grid[y - 1][x] == '#' && - grid[y + 1][x] == '#' && - grid[y][x - 1] == '#' && - grid[y][x + 1] == '#') - sum += x * y; - - return $"{sum}"; - } - - protected override string Part2() - { - //vm.Reset(); - //vm.memory[0] = 2; - //var halt = IntCodeVM.HaltType.Waiting; - //while (halt == IntCodeVM.HaltType.Waiting) - //{ - // halt = vm.Run(); - //} - return ""; - } - } -} \ No newline at end of file diff --git a/Program.cs b/Program.cs deleted file mode 100644 index 4338952..0000000 --- a/Program.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Linq; -using System.Reflection; - -namespace aoc2019 -{ - internal static class Program - { - private static void Main(string[] args) - { - var days = - Assembly.GetExecutingAssembly().GetTypes() - .Where(t => t.BaseType == typeof(Day)) - .Select(t => (Day) Activator.CreateInstance(t)) - .OrderBy(d => d.DayNumber); - - if (args.Length == 1 && int.TryParse(args[0], out var dayNum)) - { - var day = days.FirstOrDefault(d => d.DayNumber == dayNum); - - if (day != null) - day.AllParts(); - else - Console.WriteLine($"{dayNum} invalid or not yet implemented"); - } - else - { - foreach (var d in days) d.AllParts(); - } - } - } -} \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 0e6fdc8..0000000 --- a/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# [aoc2019](https://tildegit.org/ben/aoc2019) - -[![Build Status](https://drone.tildegit.org/api/badges/ben/aoc2019/status.svg)](https://drone.tildegit.org/ben/aoc2019) - -some advent of code solutions for 2019 - -starting out with c#, we'll see how it goes this year - -using .net core 3.0, run all solutions with `dotnet run` - diff --git a/aoc2019.csproj b/aoc2019.csproj deleted file mode 100644 index eaa667f..0000000 --- a/aoc2019.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - Exe - net5.0 - - - - - PreserveNewest - - - - diff --git a/aoc2019.sln b/aoc2019.sln index fe311d7..29afd37 100644 --- a/aoc2019.sln +++ b/aoc2019.sln @@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29519.181 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "aoc2019", "aoc2019.csproj", "{0F1DADD9-2DC3-4035-BE2A-1CC9BBB623A9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "aoc2019", "aoc2019\aoc2019.csproj", "{D99F8F27-0CF3-4220-95F5-B8F92D02F17D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "aoc2019.test", "aoc2019.test\aoc2019.test.csproj", "{D168189E-28FC-440F-B64C-02C6D9FBBEE0}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -11,10 +13,14 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0F1DADD9-2DC3-4035-BE2A-1CC9BBB623A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0F1DADD9-2DC3-4035-BE2A-1CC9BBB623A9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0F1DADD9-2DC3-4035-BE2A-1CC9BBB623A9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0F1DADD9-2DC3-4035-BE2A-1CC9BBB623A9}.Release|Any CPU.Build.0 = Release|Any CPU + {D99F8F27-0CF3-4220-95F5-B8F92D02F17D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D99F8F27-0CF3-4220-95F5-B8F92D02F17D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D99F8F27-0CF3-4220-95F5-B8F92D02F17D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D99F8F27-0CF3-4220-95F5-B8F92D02F17D}.Release|Any CPU.Build.0 = Release|Any CPU + {D168189E-28FC-440F-B64C-02C6D9FBBEE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D168189E-28FC-440F-B64C-02C6D9FBBEE0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D168189E-28FC-440F-B64C-02C6D9FBBEE0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D168189E-28FC-440F-B64C-02C6D9FBBEE0}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/aoc2019.test/Tests.cs b/aoc2019.test/Tests.cs new file mode 100644 index 0000000..48706a8 --- /dev/null +++ b/aoc2019.test/Tests.cs @@ -0,0 +1,56 @@ +using System; +using System.Diagnostics; +using aoc2019; +using aoc2019.lib; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace aoc2019.test +{ + [TestClass] + public class Tests + { + [DataTestMethod] + [DataRow(typeof(Day01), "3394106", "5088280")] + [DataRow(typeof(Day02), "3085697", "9425")] + [DataRow(typeof(Day03), "1195", "91518")] + [DataRow(typeof(Day04), "1079", "699")] + [DataRow(typeof(Day05), "7692125", "14340395")] + [DataRow(typeof(Day06), "145250", "274")] + [DataRow(typeof(Day07), "19650", "35961106")] + [DataRow(typeof(Day08), "2413", "xxx xx xxx xxxx xxx \r\nx x x x x x x x x \r\nxxx x x x x xxx \r\nx x x xxx x x x \r\nx x x x x x x x \r\nxxx xx x xxxx xxx ")] + [DataRow(typeof(Day09), "3409270027", "82760")] + [DataRow(typeof(Day10), "260", "608")] + [DataRow(typeof(Day11), "2054", " # # ### #### #### ## ## # # ### \r\n # # # # # # # # # # # # # \r\n ## # # # ### # # # #### ### \r\n # # ### # # #### # # # # # \r\n # # # # # # # # # # # # # # \r\n # # # # #### #### # # ## # # ### ")] + [DataRow(typeof(Day12), "10635", "583523031727256")] + [DataRow(typeof(Day13), "361", "after 7133 moves, the score is: 17590")] + [DataRow(typeof(Day14), "397771", "3126714")] + [DataRow(typeof(Day15), "280", "400")] + [DataRow(typeof(Day16), "90744714", "82994322")] + [DataRow(typeof(Day17), "2804", "")] + public void TestAllDays(Type dayType, string part1, string part2) + { + // create day instance + var s = Stopwatch.StartNew(); + var day = (Day) Activator.CreateInstance(dayType); + s.Stop(); + Assert.IsNotNull(day, "failed to create day object"); + Console.WriteLine($"{s.ScaleMilliseconds()}ms elapsed in constructor"); + + // part 1 + s.Reset(); + s.Start(); + var part1Actual = day.Part1(); + s.Stop(); + Console.WriteLine($"{s.ScaleMilliseconds()}ms elapsed in part1"); + Assert.AreEqual(part1, part1Actual, $"Incorrect answer for Day {day.DayNumber} Part1"); + + // part 2 + s.Reset(); + s.Start(); + var part2Actual = day.Part2(); + s.Stop(); + Console.WriteLine($"{s.ScaleMilliseconds()}ms elapsed in part2"); + Assert.AreEqual(part2, part2Actual, $"Incorrect answer for Day {day.DayNumber} Part2"); + } + } +} diff --git a/aoc2019.test/aoc2019.test.csproj b/aoc2019.test/aoc2019.test.csproj new file mode 100644 index 0000000..f3b9de8 --- /dev/null +++ b/aoc2019.test/aoc2019.test.csproj @@ -0,0 +1,20 @@ + + + + net5.0 + + false + + + + + + + + + + + + + + diff --git a/aoc2019/Day.cs b/aoc2019/Day.cs new file mode 100644 index 0000000..e1bdb25 --- /dev/null +++ b/aoc2019/Day.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using aoc2019.lib; + +namespace aoc2019 +{ + public abstract class Day + { + protected Day(int dayNumber, string puzzleName) + { + DayNumber = dayNumber; + PuzzleName = puzzleName; + } + + public int DayNumber { get; } + public string PuzzleName { get; } + + protected virtual IEnumerable Input => + File.ReadLines(FileName); + + protected string FileName => + Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"input/day{DayNumber,2:00}.in"); + + public void AllParts(bool verbose = true) + { + Console.WriteLine($"Day {DayNumber,2}: {PuzzleName}"); + var s = Stopwatch.StartNew(); + var part1 = Part1(); + s.Stop(); + Console.Write($"Part1: {part1,-15} "); + Console.WriteLine(verbose ? $"{s.ScaleMilliseconds()}ms elapsed" : ""); + + s.Reset(); + + s.Start(); + var part2 = Part2(); + s.Stop(); + Console.Write($"Part2: {part2,-15} "); + Console.WriteLine(verbose ? $"{s.ScaleMilliseconds()}ms elapsed" : ""); + + Console.WriteLine(); + } + + public abstract string Part1(); + public abstract string Part2(); + } +} \ No newline at end of file diff --git a/aoc2019/Day01.cs b/aoc2019/Day01.cs new file mode 100644 index 0000000..6ebdce5 --- /dev/null +++ b/aoc2019/Day01.cs @@ -0,0 +1,43 @@ +using System.Collections.Generic; +using System.Linq; + +namespace aoc2019 +{ + public sealed class Day01 : Day + { + private readonly IEnumerable masses; + + public Day01() : base(1, "The Tyranny of the Rocket Equation") + { + masses = Input.Select(int.Parse); + } + + private static int FuelCost(int weight) + { + return weight / 3 - 2; + } + + private static int FullCost(int cost) + { + int total = 0, newcost, tmp = cost; + + while ((newcost = FuelCost(tmp)) >= 0) + { + total += newcost; + tmp = newcost; + } + + return total; + } + + public override string Part1() + { + return $"{masses.Sum(FuelCost)}"; + } + + public override string Part2() + { + return $"{masses.Sum(FullCost)}"; + } + } +} \ No newline at end of file diff --git a/aoc2019/Day02.cs b/aoc2019/Day02.cs new file mode 100644 index 0000000..ce99a0a --- /dev/null +++ b/aoc2019/Day02.cs @@ -0,0 +1,46 @@ +using System.Collections.Generic; +using System.Linq; + +namespace aoc2019 +{ + public sealed class Day02 : Day + { + private readonly IEnumerable input; + + public Day02() : base(2, "1202 Program Alarm") + { + input = Input.First().Split(',').Select(int.Parse); + } + + public int RunIntCode(int noun, int verb) + { + var v = input.ToList(); + v[1] = noun; + v[2] = verb; + + for (var i = 0; v[i] != 99; i += 4) + v[v[i + 3]] = v[i] switch + { + 1 => v[v[i + 1]] + v[v[i + 2]], + 2 => v[v[i + 1]] * v[v[i + 2]] + }; + + return v[0]; + } + + public override string Part1() + { + return $"{RunIntCode(12, 2)}"; + } + + public override string Part2() + { + for (var i = 0; i < 100; i++) + for (var j = 0; j < 100; j++) + if (RunIntCode(i, j) == 19690720) + return $"{100 * i + j}"; + + return string.Empty; + } + } +} \ No newline at end of file diff --git a/aoc2019/Day03.cs b/aoc2019/Day03.cs new file mode 100644 index 0000000..bf32fb3 --- /dev/null +++ b/aoc2019/Day03.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace aoc2019 +{ + public sealed class Day03 : Day + { + private readonly IEnumerable<(int, int)> intersections; + private readonly List> wires; + + public Day03() : base(3, "Crossed Wires") + { + wires = Input.Select(ParseWire).ToList(); + intersections = wires[0].Keys.Intersect(wires[1].Keys); + } + + public override string Part1() + { + return $"{intersections.Min(x => Math.Abs(x.Item1) + Math.Abs(x.Item2))}"; + } + + public override string Part2() + { + // add 2 to count (0, 0) on both lines + return $"{intersections.Min(x => wires[0][x] + wires[1][x]) + 2}"; + } + + private static Dictionary<(int, int), int> ParseWire(string line) + { + var r = new Dictionary<(int, int), int>(); + int x = 0, y = 0, c = 0, i; + + foreach (var step in line.Split(',')) + { + var d = int.Parse(step.Substring(1)); + switch (step[0]) + { + case 'U': + for (i = 0; i < d; i++) r.TryAdd((x, ++y), c++); + break; + case 'D': + for (i = 0; i < d; i++) r.TryAdd((x, --y), c++); + break; + case 'R': + for (i = 0; i < d; i++) r.TryAdd((++x, y), c++); + break; + case 'L': + for (i = 0; i < d; i++) r.TryAdd((--x, y), c++); + break; + } + } + + return r; + } + } +} \ No newline at end of file diff --git a/aoc2019/Day04.cs b/aoc2019/Day04.cs new file mode 100644 index 0000000..808eb64 --- /dev/null +++ b/aoc2019/Day04.cs @@ -0,0 +1,49 @@ +using System.Linq; + +namespace aoc2019 +{ + public sealed class Day04 : Day + { + private readonly int end; + + private readonly int start; + + public Day04() : base(4, "Secure Container") + { + var range = Input.First().Split('-').Select(int.Parse).ToList(); + start = range[0]; + end = range[1]; + } + + private bool IsValid(int i) + { + var prev = 0; + var hasDup = false; + foreach (var c in i.ToString()) + { + var curr = c - '0'; + if (curr < prev) return false; + if (curr == prev) hasDup = true; + prev = curr; + } + + return i >= start && i <= end && hasDup; + } + + private bool HasOnePair(int i) + { + var s = i.ToString(); + return IsValid(i) && s.Select(c => s.Count(j => j == c)).Any(c => c == 2); + } + + public override string Part1() + { + return $"{Enumerable.Range(start, end).Count(IsValid)}"; + } + + public override string Part2() + { + return $"{Enumerable.Range(start, end).Count(HasOnePair)}"; + } + } +} \ No newline at end of file diff --git a/aoc2019/Day05.cs b/aoc2019/Day05.cs new file mode 100644 index 0000000..2020627 --- /dev/null +++ b/aoc2019/Day05.cs @@ -0,0 +1,78 @@ +using System.Collections.Generic; +using System.Linq; + +namespace aoc2019 +{ + public sealed class Day05 : Day + { + private readonly IEnumerable tape; + + private int output; + + public Day05() : base(5, "Sunny with a Chance of Asteroids") + { + tape = Input.First().Split(',').Select(int.Parse); + } + + public void RunIntCode(List v, int input) + { + var i = 0; + while (i < v.Count && v[i] != 99) + { + int Val(int mode, int val) + { + return mode != 0 ? val : v[val]; + } + + var mode1 = v[i] / 100 % 10; + var mode2 = v[i] / 1000; + + switch (v[i] % 100) + { + case 1: + v[v[i + 3]] = Val(mode1, v[i + 1]) + Val(mode2, v[i + 2]); + i += 4; + break; + case 2: + v[v[i + 3]] = Val(mode1, v[i + 1]) * Val(mode2, v[i + 2]); + i += 4; + break; + case 3: + v[v[i + 1]] = input; + i += 2; + break; + case 4: + output = Val(mode1, v[i + 1]); + i += 2; + break; + case 5: + i = Val(mode1, v[i + 1]) == 0 ? i + 3 : Val(mode2, v[i + 2]); + break; + case 6: + i = Val(mode1, v[i + 1]) != 0 ? i + 3 : Val(mode2, v[i + 2]); + break; + case 7: + v[v[i + 3]] = Val(mode1, v[i + 1]) < Val(mode2, v[i + 2]) ? 1 : 0; + i += 4; + break; + case 8: + v[v[i + 3]] = Val(mode1, v[i + 1]) == Val(mode2, v[i + 2]) ? 1 : 0; + i += 4; + break; + } + } + } + + public override string Part1() + { + RunIntCode(tape.ToList(), 1); + return $"{output}"; + } + + public override string Part2() + { + RunIntCode(tape.ToList(), 5); + return $"{output}"; + } + } +} \ No newline at end of file diff --git a/aoc2019/Day06.cs b/aoc2019/Day06.cs new file mode 100644 index 0000000..ede02da --- /dev/null +++ b/aoc2019/Day06.cs @@ -0,0 +1,38 @@ +using System.Collections.Generic; +using System.Linq; + +namespace aoc2019 +{ + public sealed class Day06 : Day + { + private readonly Dictionary input; + + public Day06() : base(6, "Universal Orbit Map") + { + input = Input.ToDictionary(i => i.Split(')')[1], i => i.Split(')')[0]); + } + + private List GetParents(string obj) + { + var res = new List(); + for (var curr = obj; curr != "COM"; curr = input[curr]) + res.Add(curr); + res.Add("COM"); + return res; + } + + public override string Part1() + { + return $"{input.Keys.Sum(o => GetParents(o).Count - 1)}"; + } + + public override string Part2() + { + var you = GetParents("YOU"); + var san = GetParents("SAN"); + var common = 1; + for (; you[^common] == san[^common]; common++) ; + return $"{you.Count + san.Count - common * 2}"; + } + } +} \ No newline at end of file diff --git a/aoc2019/Day07.cs b/aoc2019/Day07.cs new file mode 100644 index 0000000..10684b9 --- /dev/null +++ b/aoc2019/Day07.cs @@ -0,0 +1,67 @@ +using System.Collections.Generic; +using System.Linq; +using aoc2019.lib; + +namespace aoc2019 +{ + public sealed class Day07 : Day + { + private readonly IntCodeVM[] Amplifiers = new IntCodeVM[5]; + + public Day07() : base(7, "Amplification Circuit") + { + for (var i = 0; i < 5; i++) Amplifiers[i] = new IntCodeVM(Input.First()); + } + + public override string Part1() + { + long i, largest = 0; + + foreach (var phaseSeq in Enumerable.Range(0, 5).Permute()) + { + i = 0; + foreach (var (vm, phase) in Amplifiers.Zip(phaseSeq)) + { + vm.Reset(); + vm.Run(phase, i); + i = vm.Result; + } + + if (i > largest) + largest = i; + } + + return $"{largest}"; + } + + public override string Part2() + { + long i, largest = 0; + + foreach (var phaseSeq in Enumerable.Range(5, 5).Permute()) + { + i = 0; + foreach (var (vm, phase) in Amplifiers.Zip(phaseSeq)) + { + vm.Reset(); + vm.AddInput(phase); + } + + var vms = new Queue(Amplifiers); + while (vms.Count > 0) + { + var vm = vms.Dequeue(); + var haltType = vm.Run(i); + if (haltType == IntCodeVM.HaltType.Waiting) + vms.Enqueue(vm); + i = vm.Result; + } + + if (i > largest) + largest = i; + } + + return $"{largest}"; + } + } +} \ No newline at end of file diff --git a/aoc2019/Day08.cs b/aoc2019/Day08.cs new file mode 100644 index 0000000..ea8f587 --- /dev/null +++ b/aoc2019/Day08.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using aoc2019.lib; + +namespace aoc2019 +{ + public sealed class Day08 : Day + { + private readonly List> photo; + + public Day08() : base(8, "Space Image Format") + { + photo = Input.First().Chunk(25 * 6).Select(s => s.ToList()).ToList(); + } + + public override string Part1() + { + var l = photo.OrderBy(layer => layer.Count(pixel => pixel == '0')).First(); + return $"{l.Count(p => p == '1') * l.Count(p => p == '2')}"; + } + + public override string Part2() + { + return Enumerable.Range(0, 25 * 6) + .Select(p => Enumerable.Range(0, photo.Count) + .Select(l => photo[l][p]) + .Aggregate('2', (acc, next) => + acc != '2' ? acc : next == '0' ? ' ' : next + ) + ) + .ToDelimitedString() + .Chunk(25) + .ToDelimitedString(Environment.NewLine) + .Replace('1', 'x'); + } + } +} \ No newline at end of file diff --git a/aoc2019/Day09.cs b/aoc2019/Day09.cs new file mode 100644 index 0000000..d5edd0a --- /dev/null +++ b/aoc2019/Day09.cs @@ -0,0 +1,29 @@ +using System.Linq; +using aoc2019.lib; + +namespace aoc2019 +{ + public sealed class Day09 : Day + { + private readonly IntCodeVM vm; + + public Day09() : base(9, "Sensor Boost") + { + vm = new IntCodeVM(Input.First()); + } + + public override string Part1() + { + vm.Reset(); + vm.Run(1); + return $"{vm.output.ToDelimitedString(",")}"; + } + + public override string Part2() + { + vm.Reset(); + vm.Run(2); + return $"{vm.output.ToDelimitedString(",")}"; + } + } +} \ No newline at end of file diff --git a/aoc2019/Day10.cs b/aoc2019/Day10.cs new file mode 100644 index 0000000..6151e54 --- /dev/null +++ b/aoc2019/Day10.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using aoc2019.lib; + +namespace aoc2019 +{ + public sealed class Day10 : Day + { + private readonly HashSet<(int x, int y)> asteroids; + private (int x, int y) best = (x: -1, y: -1); + private int bestCanSee; + + public Day10() : base(10, "Monitoring Station") + { + asteroids = Input + .Select((r, y) => r.Select((c, x) => (x, y, isAsteroid: c == '#')).ToArray()) + .SelectMany(r => r) + .Where(a => a.isAsteroid) + .Select(a => (a.x, a.y)) + .ToHashSet(); + } + + public override string Part1() + { + foreach (var asteroid in asteroids) + { + var canSee = asteroids + .Except(new[] {asteroid}) + .Select(a => (x: a.x - asteroid.x, y: a.y - asteroid.y)) + .GroupBy(a => Math.Atan2(a.y, a.x)) + .Count(); + + if (canSee > bestCanSee) + { + best = asteroid; + bestCanSee = canSee; + } + } + + return $"{bestCanSee}"; + } + + public override string Part2() + { + static IEnumerable<(int x, int y, double angle, double dist)> GetValue( + Queue<(int x, int y, double angle, double dist)> q) + { + if (q.Count > 0) yield return q.Dequeue(); + } + + return asteroids + .Where(a => a != best) + .Select(a => + { + var xDist = a.x - best.x; + var yDist = a.y - best.y; + var angle = Math.Atan2(xDist, yDist); + return (a.x, a.y, angle, dist: Math.Sqrt(xDist * xDist + yDist * yDist)); + }) + .ToLookup(a => a.angle) + .OrderByDescending(a => a.Key) + .Select(a => new Queue<(int x, int y, double angle, double dist)>(a.OrderBy(b => b.dist))) + .Repeat() + .SelectMany(GetValue) + .Skip(199) + .Take(1) + .Select(a => a.x * 100 + a.y) + .Single() + .ToString(); + } + } +} \ No newline at end of file diff --git a/aoc2019/Day11.cs b/aoc2019/Day11.cs new file mode 100644 index 0000000..bce7cce --- /dev/null +++ b/aoc2019/Day11.cs @@ -0,0 +1,112 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using aoc2019.lib; + +namespace aoc2019 +{ + public sealed class Day11 : Day + { + private readonly IntCodeVM vm; + private Direction heading; + private long x, y; + + public Day11() : base(11, "Space Police") + { + vm = new IntCodeVM(Input.First()); + } + + private void Move() + { + switch (heading) + { + case Direction.Up: + y++; + break; + case Direction.Down: + y--; + break; + case Direction.Left: + x--; + break; + case Direction.Right: + x++; + break; + } + + ; + } + + private void Turn(long direction) + { + switch (heading) + { + case Direction.Up: + heading = direction == 0 ? Direction.Left : Direction.Right; + break; + case Direction.Down: + heading = direction == 0 ? Direction.Right : Direction.Left; + break; + case Direction.Left: + heading = direction == 0 ? Direction.Down : Direction.Up; + break; + case Direction.Right: + heading = direction == 0 ? Direction.Up : Direction.Down; + break; + } + + Move(); + } + + private Dictionary<(long x, long y), long> PaintShip(int initialVal) + { + var map = new Dictionary<(long, long), long>(); + vm.Reset(); + heading = Direction.Up; + x = 0; + y = 0; + map[(x, y)] = initialVal; + + var haltType = IntCodeVM.HaltType.Waiting; + while (haltType == IntCodeVM.HaltType.Waiting) + { + haltType = vm.Run(map.GetValueOrDefault((x, y))); + map[(x, y)] = vm.Result; + Turn(vm.Result); + } + + return map; + } + + public override string Part1() + { + return $"{PaintShip(0).Count}"; + } + + public override string Part2() + { + var map = PaintShip(1); + var minX = (int) map.Keys.Select(x => x.x).Min(); + var maxX = (int) map.Keys.Select(x => x.x).Max(); + var minY = (int) map.Keys.Select(x => x.y).Min(); + var maxY = (int) map.Keys.Select(x => x.y).Max(); + + return Enumerable.Range(minY, maxY - minY + 1) + .Select(y => + Enumerable.Range(minX, maxX - minX + 1) + .Select(x => map.GetValueOrDefault((x, y)) == 0 ? ' ' : '#') + .ToDelimitedString() + ) + .Reverse() + .ToDelimitedString(Environment.NewLine); + } + + private enum Direction + { + Up, + Down, + Left, + Right + } + } +} \ No newline at end of file diff --git a/aoc2019/Day12.cs b/aoc2019/Day12.cs new file mode 100644 index 0000000..04e215e --- /dev/null +++ b/aoc2019/Day12.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace aoc2019 +{ + public sealed class Day12 : Day + { + private readonly List moons; + private int step; + + public Day12() : base(12, "The N-Body Problem") + { + moons = Input + .Select(moon => + moon + .TrimStart('<') + .TrimEnd('>') + .Split(",") + .Select(val => int.Parse(val.Split("=").Last())) + ) + .Select(moon => new Position(moon.ToList())) + .ToList(); + + foreach (var moon in moons) + moon.SetSiblings(moons); + } + + public static long LCM(long a, long b) + { + return a * b / GCD(a, b); + } + + public static long GCD(long a, long b) + { + if (b == 0) return a; + return GCD(b, a % b); + } + + private void Step() + { + foreach (var moon in moons) + moon.Gravitate(); + + foreach (var moon in moons) + moon.Move(); + + step++; + } + + public override string Part1() + { + while (step < 1000) + Step(); + + return $"{moons.Sum(p => p.TotalEnergy)}"; + } + + public override string Part2() + { + int cycleX = 0, cycleY = 0, cycleZ = 0; + + while (cycleX == 0 || cycleY == 0 || cycleZ == 0) + { + Step(); + if (cycleX == 0 && moons.All(m => m.dx == 0)) cycleX = step * 2; + if (cycleY == 0 && moons.All(m => m.dy == 0)) cycleY = step * 2; + if (cycleZ == 0 && moons.All(m => m.dz == 0)) cycleZ = step * 2; + } + + return $"{LCM(cycleX, LCM(cycleY, cycleZ))}"; + } + + public class Position + { + public int dx, dy, dz; + private List siblings; + public int x, y, z; + + public Position(IList moon) + { + x = moon[0]; + y = moon[1]; + z = moon[2]; + dx = 0; + dy = 0; + dz = 0; + } + + internal int KineticEnergy => + Math.Abs(x) + Math.Abs(y) + Math.Abs(z); + + internal int PotentialEnergy => + Math.Abs(dx) + Math.Abs(dy) + Math.Abs(dz); + + internal int TotalEnergy => + KineticEnergy * PotentialEnergy; + + public void SetSiblings(List positions) + { + siblings = positions.Where(p => p != this).ToList(); + } + + public override string ToString() + { + return $"pos= vel="; + } + + internal void Gravitate() + { + foreach (var m in siblings) + { + if (x != m.x) dx += x > m.x ? -1 : 1; + if (y != m.y) dy += y > m.y ? -1 : 1; + if (z != m.z) dz += z > m.z ? -1 : 1; + } + } + + internal void Move() + { + x += dx; + y += dy; + z += dz; + } + } + } +} \ No newline at end of file diff --git a/aoc2019/Day13.cs b/aoc2019/Day13.cs new file mode 100644 index 0000000..4d919e7 --- /dev/null +++ b/aoc2019/Day13.cs @@ -0,0 +1,87 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using aoc2019.lib; + +namespace aoc2019 +{ + public sealed class Day13 : Day + { + private readonly Dictionary<(int x, int y), int> board; + + private readonly IntCodeVM vm; + + public Day13() : base(13, "Care Package") + { + vm = new IntCodeVM(Input.First()); + board = new Dictionary<(int, int), int>(); + } + + private void UpdateTiles(IEnumerable queue) + { + var input = queue.Select(i => (int) i).ToList(); + + for (var i = 0; i < input.Count - 2; i += 3) + { + var x = input[i]; + var y = input[i + 1]; + var val = input[i + 2]; + + if (board.ContainsKey((x, y))) + board[(x, y)] = val; + else + board.Add((x, y), val); + } + } + + private void PrintBoard() + { + foreach (var ((x, y), value) in board) + { + if (x < 0 || y < 0) continue; + Console.SetCursorPosition(x, y); + Console.Write(value switch + { + 0 => " ", + 1 => "|", + 2 => "B", + 3 => "_", + 4 => ".", + _ => value + }); + } + } + + public override string Part1() + { + vm.Reset(); + vm.Run(); + return $"{vm.output.Where((v, i) => (i + 1) % 3 == 0 && v == 2).Count()}"; + } + + public override string Part2() + { + vm.Reset(); + vm.memory[0] = 2; + var printBoard = false; + var gameTicks = 0; + if (printBoard) Console.Clear(); + + var haltType = IntCodeVM.HaltType.Waiting; + while (haltType == IntCodeVM.HaltType.Waiting) + { + haltType = vm.Run(); + UpdateTiles(vm.output); + + var (ball, _) = board.First(t => t.Value == 4).Key; + var (paddle, _) = board.First(t => t.Value == 3).Key; + vm.AddInput(ball > paddle ? 1 : ball < paddle ? -1 : 0); + + gameTicks++; + if (printBoard) PrintBoard(); + } + + return $"after {gameTicks} moves, the score is: {board[(-1, 0)]}"; + } + } +} \ No newline at end of file diff --git a/aoc2019/Day14.cs b/aoc2019/Day14.cs new file mode 100644 index 0000000..af7af42 --- /dev/null +++ b/aoc2019/Day14.cs @@ -0,0 +1,110 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace aoc2019 +{ + public sealed class Day14 : Day + { + private readonly Dictionary reactions; + + private Dictionary available; + + public Day14() : base(14, "Space Stoichiometry") + { + reactions = Input + .Select(Reaction.Parse) + .ToDictionary(r => r.product.Name); + } + + private bool Consume(string chem, long quantity) + { + if (quantity <= 0) + throw new ArgumentOutOfRangeException(nameof(quantity)); + + if (!available.ContainsKey(chem)) + available[chem] = 0; + + if (available[chem] < quantity && !Produce(chem, quantity - available[chem])) + return false; + + available[chem] -= quantity; + return true; + } + + private bool Produce(string chem, long quantity) + { + if (chem == "ORE") + return false; + + var reaction = reactions[chem]; + var reactionCount = (long) Math.Ceiling((double) quantity / reaction.product.Quantity); + + foreach (var reactant in reaction.reactants) + if (!Consume(reactant.Name, reactionCount * reactant.Quantity)) + return false; + + available[chem] = available.GetValueOrDefault(chem) + reactionCount * reaction.product.Quantity; + return true; + } + + public override string Part1() + { + available = new Dictionary {{"ORE", long.MaxValue}}; + Consume("FUEL", 1); + return $"{long.MaxValue - available["ORE"]}"; + } + + public override string Part2() + { + const long capacity = 1_000_000_000_000; + available = new Dictionary {{"ORE", capacity}}; + Consume("FUEL", 1); + + var oreConsumed = capacity - available["ORE"]; + while (Produce("FUEL", Math.Max(1, available["ORE"] / oreConsumed))) + { + } + + return $"{available["FUEL"] + 1}"; + } + + private struct Component + { + public string Name { get; set; } + public int Quantity { get; set; } + } + + private class Reaction + { + public readonly Component product; + public readonly Component[] reactants; + + private Reaction(Component[] reactants, Component product) + { + this.reactants = reactants; + this.product = product; + } + + public static Reaction Parse(string s) + { + var ss = s.Split(new[] {", ", " => "}, StringSplitOptions.None); + + return new Reaction( + ss.Take(ss.Length - 1).Select(ParseComponent).ToArray(), + ParseComponent(ss[^1]) + ); + + static Component ParseComponent(string s) + { + var spl = s.Split(' ', 2); + return new Component + { + Quantity = int.Parse(spl[0]), + Name = spl[1] + }; + } + } + } + } +} \ No newline at end of file diff --git a/aoc2019/Day15.cs b/aoc2019/Day15.cs new file mode 100644 index 0000000..59d720c --- /dev/null +++ b/aoc2019/Day15.cs @@ -0,0 +1,224 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using aoc2019.lib; + +namespace aoc2019 +{ + public sealed class Day15 : Day + { + private readonly bool verbose = false; + private readonly IntCodeVM vm; + + public Day15() : base(15, "Oxygen System") + { + vm = new IntCodeVM(Input.First()); + } + + public override string Part1() + { + vm.Reset(); + var currentLocation = new Location(0, 0); + var halt = IntCodeVM.HaltType.Waiting; + while (halt == IntCodeVM.HaltType.Waiting) + { + var direction = currentLocation.NextDirection(); + if (direction <= 4) + { + var (x, y) = currentLocation.Neighbor(direction); + if (Location.GetLocation(x, y) == null) + { + halt = vm.Run(direction); + switch (vm.Result) + { + case Location.Wall: + new Location(x, y, Location.Opposites[direction], Location.Wall); + break; + case Location.Empty: + currentLocation = new Location(x, y, Location.Opposites[direction]); + break; + case Location.System: + currentLocation = new Location(x, y, Location.Opposites[direction], Location.System); + break; + default: + throw new Exception($"Unknown IntCodeVM response: {vm.Result}"); + } + } + } + else + { + direction = currentLocation.PreviousDirection; + if (direction > 0) + { + halt = vm.Run(direction); + switch (vm.Result) + { + case Location.Empty: + case Location.System: + currentLocation = Location.GetLocation(currentLocation.Neighbor(direction)); + break; + default: + throw new Exception($"Unknown or unexpected response for previous room: {vm.Result}"); + } + } + else + { + if (verbose) + { + // find extents of canvas + int xMin, xMax, yMin, yMax; + xMin = yMin = int.MaxValue; + xMax = yMax = int.MinValue; + foreach (var (x, y) in Location.AllLocations.Keys) + { + if (x < xMin) xMin = x; + if (x > xMax) xMax = x; + if (y < yMin) yMin = y; + if (y > yMax) yMax = y; + } + + Console.WriteLine($"Canvas extends from ({xMin}, {yMin}) to ({xMax}, {yMax})"); + + // print board + for (var y = yMin; y <= yMax; y++) + { + var line = ""; + for (var x = xMin; x <= xMax; x++) + if (Location.AllLocations.ContainsKey((x, y))) + line += Location.AllLocations[(x, y)].Image(); + else + line += "@"; + + Console.WriteLine(line); + } + } + + currentLocation = Location.OxygenLocation; + var distance = 0; + while (currentLocation.PreviousDirection != 0) + { + distance++; + currentLocation = Location.GetLocation(currentLocation.PreviousLocation()); + } + + return $"{distance}"; + } + } + } + + return ""; + } + + public override string Part2() + { + var changed = true; + while (changed) + { + changed = false; + foreach (var location in Location.AllLocations.Values) + changed = location.UpdateDistanceToOxygenSystem() || changed; + } + + return Location.AllLocations.Values + .Where(l => !l.IsWall) + .Max(l => l.DistanceToOxygenSystem) + .ToString(); + } + + private class Location + { + public const int Wall = 0; + public const int Empty = 1; + public const int System = 2; + + private static readonly int[] Dx = {0, 0, 0, 1, -1}; + private static readonly int[] Dy = {0, 1, -1, 0, 0}; + public static readonly int[] Opposites = {0, 2, 1, 4, 3}; + + public static readonly Dictionary<(int x, int y), Location> + AllLocations = new Dictionary<(int x, int y), Location>(); + + private readonly int currentType; + public int DistanceToOxygenSystem = int.MaxValue - 1; + + private int searchDirection = 1; + + public Location(int x, int y, int prev = 0, int type = Empty) + { + PreviousDirection = prev; + currentType = type; + X = x; + Y = y; + + if (type == System) + { + OxygenLocation = this; + DistanceToOxygenSystem = 0; + // Console.WriteLine($"Found Oxygen System at ({x}, {y})"); + } + + AllLocations.Add((x, y), this); + } + + public static Location OxygenLocation { get; private set; } + public int PreviousDirection { get; } + private int X { get; } + private int Y { get; } + + public bool IsWall => currentType == Wall; + + public string Image() + { + return currentType switch + { + Wall => "\u2587", + Empty => X == 0 && Y == 0 ? "S" : " ", + System => "O", + _ => "?" + }; + } + + public bool UpdateDistanceToOxygenSystem() + { + if (currentType != Empty) return false; + + foreach (var direction in Enumerable.Range(1, 4)) + { + var distance = GetLocation(Neighbor(direction))?.DistanceToOxygenSystem ?? int.MaxValue; + if (distance + 1 < DistanceToOxygenSystem) + { + DistanceToOxygenSystem = distance + 1; + return true; + } + } + + return false; + } + + public (int, int) Neighbor(int direction) + { + return (X + Dx[direction], Y + Dy[direction]); + } + + public (int, int) PreviousLocation() + { + return Neighbor(PreviousDirection); + } + + public int NextDirection() + { + return searchDirection++; + } + + public static Location GetLocation(int x, int y) + { + return AllLocations.ContainsKey((x, y)) ? AllLocations[(x, y)] : null; + } + + public static Location GetLocation((int x, int y) coords) + { + return GetLocation(coords.x, coords.y); + } + } + } +} \ No newline at end of file diff --git a/aoc2019/Day16.cs b/aoc2019/Day16.cs new file mode 100644 index 0000000..310363a --- /dev/null +++ b/aoc2019/Day16.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using aoc2019.lib; + +namespace aoc2019 +{ + public sealed class Day16 : Day + { + private static readonly int[] BasePattern = {0, 1, 0, -1}; + private readonly int[] initialList; + + public Day16() : base(16, "Flawed Frequency Transmission") + { + initialList = Input.First().Select(c => int.Parse($"{c}")).ToArray(); + } + + public override string Part1() + { + const int phaseCount = 100; + var signal0 = initialList.ToArray(); + var signal1 = new int[signal0.Length]; + + for (var i = 0; i < phaseCount; i++) + CalculateSignal(i % 2 == 0 ? signal0 : signal1, i % 2 == 0 ? signal1 : signal0); + + return new string( + signal0.Take(8).Select(c => (char) (c + '0')) + .ToArray()); + } + + public override string Part2() + { + const int phaseCount = 100; + var messageOffset = initialList.Take(7).Aggregate((n, i) => n * 10 + i); + var signal = initialList.Repeat(10_000).Skip(messageOffset).ToArray(); + + for (var p = 0; p < phaseCount; p++) + { + signal[^1] %= 10; + for (var i = signal.Length - 2; i >= 0; i--) + signal[i] = (signal[i + 1] + signal[i]) % 10; + } + + return new string(signal.Take(8).Select(c => (char) (c + '0')).ToArray()); + } + + private static void CalculateSignal(IReadOnlyList input, IList output) + { + for (var outputIndex = 0; outputIndex < output.Count; outputIndex++) + output[outputIndex] = + Math.Abs(PatternValues(outputIndex, input.Count).Select((pv, i) => pv * input[i] % 10).Sum()) % 10; + } + + private static IEnumerable PatternValues(int index, int count) + { + return BasePattern + .SelectMany(v => Enumerable.Repeat(v, index + 1)) + .Repeat(int.MaxValue) + .Skip(1) + .Take(count); + } + } +} \ No newline at end of file diff --git a/aoc2019/Day17.cs b/aoc2019/Day17.cs new file mode 100644 index 0000000..557881e --- /dev/null +++ b/aoc2019/Day17.cs @@ -0,0 +1,54 @@ +using System; +using System.Linq; +using System.Text; +using aoc2019.lib; + +namespace aoc2019 +{ + public sealed class Day17 : Day + { + private const bool Verbose = false; + + private readonly IntCodeVM vm; + + public Day17() : base(17, "Set and Forget") + { + vm = new IntCodeVM(Input.First()); + } + + public override string Part1() + { + vm.Reset(); + vm.Run(); + var sb = new StringBuilder(); + while (vm.output.Any()) + sb.Append((char) vm.Result); + if (Verbose) Console.Write(sb); + var grid = sb.ToString().Trim().Split().Select(s => s.ToCharArray()).ToArray(); + + var sum = 0; + for (var y = 1; y < grid.Length - 1; y++) + for (var x = 1; x < grid[y].Length - 1; x++) + if (grid[y][x] == '#' && + grid[y - 1][x] == '#' && + grid[y + 1][x] == '#' && + grid[y][x - 1] == '#' && + grid[y][x + 1] == '#') + sum += x * y; + + return $"{sum}"; + } + + public override string Part2() + { + //vm.Reset(); + //vm.memory[0] = 2; + //var halt = IntCodeVM.HaltType.Waiting; + //while (halt == IntCodeVM.HaltType.Waiting) + //{ + // halt = vm.Run(); + //} + return ""; + } + } +} \ No newline at end of file diff --git a/aoc2019/Program.cs b/aoc2019/Program.cs new file mode 100644 index 0000000..c523439 --- /dev/null +++ b/aoc2019/Program.cs @@ -0,0 +1,32 @@ +using System; +using System.Linq; +using System.Reflection; + +namespace aoc2019 +{ + internal static class Program + { + private static void Main(string[] args) + { + var days = + Assembly.GetExecutingAssembly().GetTypes() + .Where(t => t.BaseType == typeof(Day)) + .Select(t => (Day) Activator.CreateInstance(t)) + .OrderBy(d => d.DayNumber); + + if (args.Length == 1 && int.TryParse(args[0], out var dayNum)) + { + var day = days.FirstOrDefault(d => d.DayNumber == dayNum); + + if (day != null) + day.AllParts(); + else + Console.WriteLine($"{dayNum} invalid or not yet implemented"); + } + else + { + foreach (var d in days) d.AllParts(); + } + } + } +} \ No newline at end of file diff --git a/aoc2019/README.md b/aoc2019/README.md new file mode 100644 index 0000000..0e6fdc8 --- /dev/null +++ b/aoc2019/README.md @@ -0,0 +1,10 @@ +# [aoc2019](https://tildegit.org/ben/aoc2019) + +[![Build Status](https://drone.tildegit.org/api/badges/ben/aoc2019/status.svg)](https://drone.tildegit.org/ben/aoc2019) + +some advent of code solutions for 2019 + +starting out with c#, we'll see how it goes this year + +using .net core 3.0, run all solutions with `dotnet run` + diff --git a/aoc2019/aoc2019.csproj b/aoc2019/aoc2019.csproj new file mode 100644 index 0000000..494194f --- /dev/null +++ b/aoc2019/aoc2019.csproj @@ -0,0 +1,14 @@ + + + + Exe + net5.0 + + + + + PreserveNewest + + + + diff --git a/aoc2019/input/day01.in b/aoc2019/input/day01.in new file mode 100644 index 0000000..fb4481d --- /dev/null +++ b/aoc2019/input/day01.in @@ -0,0 +1,100 @@ +94735 +80130 +127915 +145427 +89149 +91232 +100629 +97340 +86278 +87034 +147351 +123045 +91885 +85973 +64130 +113244 +58968 +76296 +127931 +98145 +120731 +98289 +110340 +118285 +60112 +57177 +58791 +59012 +66950 +139387 +145378 +86204 +147082 +84956 +134161 +148664 +74278 +96746 +144525 +81214 +70966 +107050 +134179 +138587 +80236 +139871 +104439 +64643 +145453 +94791 +51690 +94189 +148476 +79956 +81760 +149796 +109544 +57533 +142999 +126419 +115434 +57092 +64244 +109663 +94701 +109265 +145851 +95183 +84433 +53818 +106234 +127380 +149774 +59601 +138851 +54488 +100877 +136952 +61538 +67705 +60299 +130769 +113176 +106723 +133280 +111065 +63688 +139307 +122703 +60162 +89567 +63994 +66608 +126376 +136052 +112255 +98525 +134023 +141479 +98200 diff --git a/aoc2019/input/day02.in b/aoc2019/input/day02.in new file mode 100644 index 0000000..c3ac93e --- /dev/null +++ b/aoc2019/input/day02.in @@ -0,0 +1 @@ +1,0,0,3,1,1,2,3,1,3,4,3,1,5,0,3,2,10,1,19,1,19,9,23,1,23,13,27,1,10,27,31,2,31,13,35,1,10,35,39,2,9,39,43,2,43,9,47,1,6,47,51,1,10,51,55,2,55,13,59,1,59,10,63,2,63,13,67,2,67,9,71,1,6,71,75,2,75,9,79,1,79,5,83,2,83,13,87,1,9,87,91,1,13,91,95,1,2,95,99,1,99,6,0,99,2,14,0,0 diff --git a/aoc2019/input/day03.in b/aoc2019/input/day03.in new file mode 100644 index 0000000..d8a6b32 --- /dev/null +++ b/aoc2019/input/day03.in @@ -0,0 +1,2 @@ +R1008,U336,R184,D967,R451,D742,L235,U219,R57,D439,R869,U207,L574,U670,L808,D675,L203,D370,L279,U448,L890,U297,R279,D613,L411,D530,L372,D88,R986,U444,R319,D95,L385,D674,R887,U855,R794,U783,R633,U167,L587,D545,L726,D196,R681,U609,R677,U881,R153,D724,L63,U246,R343,U315,R580,U872,L516,U95,R463,D809,R9,U739,R540,U670,L434,D699,L158,U47,L383,D483,L341,U61,R933,D269,R816,D589,R488,D169,R972,D534,L995,D277,L887,D657,R628,D322,R753,U813,L284,D237,R676,D880,L50,D965,L401,D619,R858,U313,L156,U535,R664,U447,L251,U168,L352,U881,L734,U270,L177,D903,L114,U998,L102,D149,R848,D586,L98,D157,R942,U496,R857,U362,R398,U86,R469,U358,L721,D631,R176,D365,L112,U472,L557,D153,R97,D639,L457,U566,R570,U106,R504,D292,L94,U499,R358,U653,L704,D627,R544,D24,L407,U513,R28,U643,L510,U579,R825,D376,L867,U999,R134,D734,R654,D989,L920,U872,R64,U626,R751,D425,R620,U274,L471,D83,R979,U577,L43,D320,R673,D187,R300,U134,L451,D717,R857,U576,R570,U988,R745,U840,R799,U809,R573,U354,L208,D976,L417,U473,L555,U563,L955,U823,R712,D869,L145,D735,L780,D74,R421,U42,L158,U689,R718,D455,L670,U128,L744,U401,R149,U102,L122,U832,R872,D40,R45,D325,L553,U980,L565,D497,L435,U647,L209,D822,L593,D28,R936,U95,R349,U511,L243,U895,R421,U336,L986,U264,R376,D183,R480,D947,R416,D706,R118,D799,R424,D615,R384,U185,L338,U14,R576,D901,L734,D417,L62,D254,R784,D973,R987,D848,R32,D72,L535,D633,L668,D664,R308,D474,L418,D39,L473,U388,L518,D544,R118,D948,L844,D956,R605,U14,L948,D78,L689,U443,L996,U932,R81,D879,R556,D633,R131 +L993,U227,L414,U228,L304,U53,R695,U765,R162,D264,L530,U870,R771,D395,R27,D200,L235,D834,L559,D128,R284,U912,L959,U358,R433,U404,L539,U799,R271,D734,L104,U261,R812,D15,L474,U887,R606,U366,L694,U156,R385,D667,L329,D434,R745,U776,L319,U756,R208,D457,R705,U999,R284,U98,L657,U214,R639,D937,R675,U444,L891,D587,L914,D4,R294,D896,R534,D584,L887,U878,L807,U202,R505,U234,L284,D5,R667,U261,L127,D482,R777,D223,L707,D468,L606,U345,L509,D967,R437,U995,R28,D376,L2,D959,L814,U702,L38,D154,L79,D439,L259,U143,L376,U700,R894,U165,L300,D58,R631,D47,R684,U935,R262,D857,R797,D599,L705,U792,R439,D444,R398,D887,L81,D40,R671,U332,L820,U252,R691,U412,L794,D661,R810,U157,R858,U566,R892,D543,R10,D725,L653,D812,R733,D804,R816,U862,R994,U221,L33,U271,R766,D591,R575,D970,R152,D693,L916,U404,L658,D847,L605,D433,L583,U587,L129,D103,R407,U780,L901,D676,L846,D687,L9,D47,R295,D597,L808,U134,L186,D676,L62,U305,L73,D369,L468,U30,L472,U280,L413,U961,L98,D966,R308,D178,L21,D789,L871,D671,R665,U927,L906,U633,L135,D894,R110,D205,R324,D665,R143,D450,L978,U385,R442,D853,L518,U542,R211,U857,R119,D872,L246,U380,L874,U463,R153,U982,R832,D784,L652,U545,R71,U386,R427,D827,R986,U870,R959,U232,R509,U675,R196,U389,R944,U149,R152,U571,R527,U495,L441,U511,L899,D996,L707,D455,L358,D423,L14,D427,R144,D703,L243,U157,R876,D538,R26,D577,L385,U622,L149,D852,L225,U475,L811,D520,L226,U523,L338,D79,R565,U766,L609,U496,L189,D446,R63,U396,L629,U312,L841,D639,R466,U808,L60,D589,L146,U114,R165,U96,L809,D704,L61 \ No newline at end of file diff --git a/aoc2019/input/day04.in b/aoc2019/input/day04.in new file mode 100644 index 0000000..6190bcb --- /dev/null +++ b/aoc2019/input/day04.in @@ -0,0 +1 @@ +245318-765747 diff --git a/aoc2019/input/day05.in b/aoc2019/input/day05.in new file mode 100644 index 0000000..4d8fafe --- /dev/null +++ b/aoc2019/input/day05.in @@ -0,0 +1 @@ +3,225,1,225,6,6,1100,1,238,225,104,0,1002,114,46,224,1001,224,-736,224,4,224,1002,223,8,223,1001,224,3,224,1,223,224,223,1,166,195,224,1001,224,-137,224,4,224,102,8,223,223,101,5,224,224,1,223,224,223,1001,169,83,224,1001,224,-90,224,4,224,102,8,223,223,1001,224,2,224,1,224,223,223,101,44,117,224,101,-131,224,224,4,224,1002,223,8,223,101,5,224,224,1,224,223,223,1101,80,17,225,1101,56,51,225,1101,78,89,225,1102,48,16,225,1101,87,78,225,1102,34,33,224,101,-1122,224,224,4,224,1002,223,8,223,101,7,224,224,1,223,224,223,1101,66,53,224,101,-119,224,224,4,224,102,8,223,223,1001,224,5,224,1,223,224,223,1102,51,49,225,1101,7,15,225,2,110,106,224,1001,224,-4539,224,4,224,102,8,223,223,101,3,224,224,1,223,224,223,1102,88,78,225,102,78,101,224,101,-6240,224,224,4,224,1002,223,8,223,101,5,224,224,1,224,223,223,4,223,99,0,0,0,677,0,0,0,0,0,0,0,0,0,0,0,1105,0,99999,1105,227,247,1105,1,99999,1005,227,99999,1005,0,256,1105,1,99999,1106,227,99999,1106,0,265,1105,1,99999,1006,0,99999,1006,227,274,1105,1,99999,1105,1,280,1105,1,99999,1,225,225,225,1101,294,0,0,105,1,0,1105,1,99999,1106,0,300,1105,1,99999,1,225,225,225,1101,314,0,0,106,0,0,1105,1,99999,1107,226,677,224,102,2,223,223,1006,224,329,101,1,223,223,1108,226,677,224,1002,223,2,223,1005,224,344,101,1,223,223,8,226,677,224,102,2,223,223,1006,224,359,1001,223,1,223,1007,226,677,224,1002,223,2,223,1005,224,374,101,1,223,223,1008,677,677,224,1002,223,2,223,1005,224,389,1001,223,1,223,1108,677,226,224,1002,223,2,223,1006,224,404,1001,223,1,223,1007,226,226,224,1002,223,2,223,1005,224,419,1001,223,1,223,1107,677,226,224,1002,223,2,223,1006,224,434,101,1,223,223,108,677,677,224,1002,223,2,223,1005,224,449,1001,223,1,223,1107,677,677,224,102,2,223,223,1005,224,464,1001,223,1,223,108,226,226,224,1002,223,2,223,1006,224,479,1001,223,1,223,1008,226,226,224,102,2,223,223,1005,224,494,101,1,223,223,108,677,226,224,102,2,223,223,1005,224,509,1001,223,1,223,8,677,226,224,1002,223,2,223,1006,224,524,101,1,223,223,7,226,677,224,1002,223,2,223,1006,224,539,101,1,223,223,7,677,226,224,102,2,223,223,1006,224,554,1001,223,1,223,7,226,226,224,1002,223,2,223,1006,224,569,101,1,223,223,107,677,677,224,102,2,223,223,1006,224,584,101,1,223,223,1108,677,677,224,102,2,223,223,1006,224,599,1001,223,1,223,1008,677,226,224,1002,223,2,223,1005,224,614,1001,223,1,223,8,677,677,224,1002,223,2,223,1006,224,629,1001,223,1,223,107,226,677,224,1002,223,2,223,1006,224,644,101,1,223,223,1007,677,677,224,102,2,223,223,1006,224,659,101,1,223,223,107,226,226,224,1002,223,2,223,1006,224,674,1001,223,1,223,4,223,99,226 \ No newline at end of file diff --git a/aoc2019/input/day06.in b/aoc2019/input/day06.in new file mode 100644 index 0000000..2868a3f --- /dev/null +++ b/aoc2019/input/day06.in @@ -0,0 +1,1110 @@ +HL2)HP5 +PD5)SVL +GGS)YTS +59G)C67 +V3R)BTY +B9B)4QH +P42)PNP +3MR)YPD +HPL)T7M +9T9)BV2 +QTG)LZM +LYL)2K1 +ZM2)CCK +983)QLL +WYK)SKS +G2H)5QT +GW2)39Q +K68)HBF +FLF)GYC +Y8H)B69 +H61)TSN +J6L)PZH +BD3)WSD +321)HZ7 +FC4)X58 +7M7)SR7 +KXX)S7P +JBT)HFR +DPQ)96V +47S)36P +JQ8)FJL +1PX)J2L +DR8)HJ5 +1P6)GS4 +LXJ)WDK +8BB)LYL +TPD)9XH +5ZB)TML +ZYQ)DLC +1D2)L82 +SZX)TLH +3HG)2Z4 +T16)DT9 +TDS)8PD +Y9F)VNZ +7NW)LQD +F5W)88Z +YQH)N7L +TRH)V7C +FHB)WDL +DT3)BHQ +4Q8)MXM +J1X)5DP +172)6NG +SR7)FLL +DT9)PZP +M8V)FY6 +RXG)Y4B +H5F)9G9 +B53)F72 +9JQ)2WM +422)BQD +96B)6XD +F89)LCS +F59)9H9 +J73)JQ9 +PNV)BC3 +B84)N4Y +9FC)7L8 +2ZK)79Z +7CM)6R3 +2LL)N46 +DXF)2RH +C6Q)JVW +96V)4FT +G86)3CT +Y4D)33X +MXM)BCN +KRR)S7L +BKX)8FF +RQ7)RLG +6Q5)93D +YCZ)J41 +ZSM)QGQ +R72)2QY +848)SZX +93D)Z9Q +X5S)T2M +1H4)6Q5 +3F1)M8L +Y4W)FLF +K7D)1DD +CGL)8VF +N46)LCX +WDL)XHZ +YZ4)SC1 +6K8)D4Z +Z2B)F5J +SQF)1BV +NK2)BXT +SF7)H5Y +HBF)2GM +7RN)5N6 +9XH)YGR +P7L)HWR +CRR)5JF +GGG)L41 +3JH)HVX +BCH)LNN +4BG)XGX +JCZ)Q5T +SYH)H2H +CLB)TTD +1QW)MX8 +F58)9C6 +DZY)B84 +D76)LX2 +JDC)RKC +55J)B9B +DQY)1RB +41Q)VN9 +TQW)CY7 +G1F)SYH +9MQ)G1F +H1W)3LQ +Y5C)QBJ +CCK)PYL +C6D)P9Y +837)N5C +ZKQ)SPV +DT9)37T +FSQ)GQG +3GY)6BC +TP6)JWB +X42)9Y6 +Z9Q)3G2 +FF9)CFX +WJ8)873 +TPP)VK6 +5ZY)DT3 +1LM)63J +21Z)SQF +RQT)VQT +CSP)H3T +3PC)S6B +337)D7H +HZ7)XRK +36P)8VL +R2C)LTF +NXN)5DQ +S24)5PL +X8H)7D5 +LW1)GYR +H14)9SQ +P15)76B +31W)NX3 +QTH)97M +35S)7XM +DK7)VGQ +VNZ)BGT +T6V)1MB +JK4)H92 +BV1)ZPR +3YG)7WM +YNL)JQ8 +H92)C6G +5GH)R7B +4SK)X7R +KYK)VTJ +DWX)13Z +2QN)XC3 +MPF)CFJ +2DW)G9R +KGF)V15 +BQD)W9L +CX6)LRG +TGZ)KC3 +1S6)YCZ +S7L)3JH +K83)C6Q +H1X)K9L +ZPV)QYC +Z7D)CMZ +PVY)SNN +RVP)5B4 +4SX)5J5 +WK5)C4P +XZ3)8XF +T3J)337 +X5D)DR8 +S6B)9FC +4Z9)1F3 +HF3)VCN +C37)2H4 +71S)NYD +1MB)7CH +TXD)LYX +SF3)P7L +X4Z)VX8 +XRL)RTX +F7V)QMZ +VR9)MHV +F6P)4FB +SC1)N9V +QSH)SG5 +GVP)5DL +C4G)T1T +VH1)RH4 +MZW)4W5 +R7B)MRX +P4F)PY4 +7YW)577 +Y1Y)NGJ +642)M1Z +BLQ)Y4H +3DT)PRB +DPQ)K8G +JKL)N97 +7KZ)ZY4 +CX6)8RN +WM5)W5L +QBM)NK2 +2Z4)X8H +T1T)5BV +2GM)5WD +LZM)V3R +S61)RN6 +744)BD2 +VQT)WBH +QVF)YGJ +P4B)XCQ +J41)3FX +NCP)BL5 +1NK)VPM +9H9)47S +T92)5X8 +W9W)439 +ST9)HTJ +SMD)1NK +DGW)2QN +T7N)LDH +Y9B)3HG +BBW)3DP +QQS)1H3 +YNM)P4F +J4X)KK5 +XHS)FJP +L82)HVP +K9L)2RT +1VG)35S +7GK)RD6 +1QV)BL4 +5NM)Z91 +FK8)DWX +JQ9)7TN +5J5)X7L +5X8)837 +1DD)VYM +PKR)1QV +V32)Y5C +QMZ)XSF +CPY)8KQ +Y23)DQH +P9Y)YBY +DQH)QQS +S98)VB3 +DGF)MS9 +MTR)T5J +PZP)6CK +G6T)3G9 +JYX)ZSM +9G9)J2Q +F2F)NF1 +8X9)JGY +7N3)91G +CJX)PCK +3BR)FP2 +HTQ)JF1 +XW6)XXN +Y47)LZQ +ZZZ)Y23 +VYM)TXW +9G6)27H +Q5T)YLK +BV2)C1N +GZ4)K83 +QXJ)JYX +M8P)YSL +741)VSZ +QXP)BFG +X2H)TJ1 +H2H)G1T +L41)NH6 +QBJ)8BB +XN5)LTC +26R)W2M +2N6)YJD +3LN)XHS +LRG)V65 +4W5)B8Y +HG6)QC9 +Z3L)GFD +MLK)Y1Y +13Z)LCC +4QH)G2H +XSF)M8R +VH7)K7D +V8N)YBV +751)7CM +NW1)P5H +7FK)SHV +R6J)V32 +TK7)H61 +2WM)26R +8RN)5VS +BSF)5ZB +WW5)QXV +N42)2JB +FKG)V4R +Q5T)7GK +XBL)546 +1TC)Z4Y +4F9)ZKZ +XRK)J4X +JZK)XN5 +W23)GZB +V65)TQW +BF7)DXT +726)3F1 +L84)M8P +PDX)9QY +7D4)QSN +439)SCX +WBL)X42 +9NG)P36 +R51)R17 +Z9F)321 +SSS)NSV +DQ4)P15 +R2D)2J4 +LDH)V8N +96V)8J9 +J9C)JDC +YBD)RQ3 +7FK)RSW +YJD)1X7 +LYX)VSR +HWZ)1T5 +W32)B53 +CT7)FPL +YLH)HS7 +C67)2F6 +TGL)1D2 +XH1)751 +B95)TP6 +918)97J +LC7)52P +4W5)Y9F +5DP)XRP +JF1)KXX +95P)8NP +SR8)HG8 +5ZB)D9Q +NRG)F2Z +FMT)J6S +2RC)DGF +4GZ)BXH +4FB)LWM +2YN)69M +PCK)9VS +9W8)L84 +SMH)JHR +B2X)WM5 +96B)BL2 +F7V)R3L +DR3)JBY +ZF8)WRJ +1RB)KTP +TWN)5QY +N7L)WLK +XM8)NRG +T84)6K8 +FY6)XDY +6GC)B9W +HFR)JRG +6BC)SYX +MM1)53N +TDS)KPB +CSD)VJN +XDC)DK7 +6GV)KRR +5JW)15B +VTJ)SMD +MMS)4Z9 +7WM)L7Q +7XM)3PC +QGQ)2GB +WXR)G6T +MTP)65C +5RP)C4G +PP3)Y2M +9SV)27Y +1ZD)2ZK +D2B)7TC +5BV)9MQ +V15)844 +CMZ)1VG +6SH)BKX +C41)366 +3V4)DPQ +8BB)MZW +HXL)X88 +2YN)JKL +YPD)9PN +SPV)YOU +64L)S24 +VGK)ZF1 +ZJN)3WG +CSP)T7N +7CH)MWB +3DP)YNN +37T)3V4 +Z5N)J1Z +578)FPJ +QYC)YNL +52P)FXJ +844)3GY +PWJ)S98 +RB9)M14 +T84)F89 +C58)TCC +YVT)XW6 +P49)STW +ZPR)TPD +Y4W)QFY +BNJ)VGT +3FX)1TC +SP3)FNK +B4Y)PKR +WHY)TDS +VVL)Z5D +C99)GS9 +3WQ)MST +33X)7D4 +BLD)9JQ +MQN)QRP +M8R)ST9 +5DL)1P6 +5QY)D2V +X7R)LSR +BXT)MG4 +6TQ)LVD +XZQ)2KZ +PKW)V3X +QXP)95S +RRY)WLQ +KK5)VH7 +PCG)1RS +SYX)SKW +GS9)ZPV +JBT)62J +N42)PJF +5QT)JYF +QMQ)QRD +W1P)WJY +YD2)51R +XPL)4L3 +RXS)ZF8 +B8B)3ZN +JGY)R51 +9QY)WXJ +SHY)Y9B +HG8)TKR +L7Q)SZG +NYM)9T9 +ZY4)6SF +879)41Q +YBY)LBZ +RNN)J9C +LB6)XQG +48W)XPL +W5K)TYT +JHR)94L +2P8)QBM +ZW3)BF7 +JBD)1GF +X4Z)9NG +HC7)PD5 +7JK)GNY +HQB)31W +M8L)JK4 +LBZ)7NP +FC4)932 +KGF)WW6 +6R3)Z2B +1MM)3F3 +WXR)8BP +SM6)JSD +8WV)6C1 +Z9M)S99 +GZB)MTR +39Q)1VY +VR9)PBP +B6D)MLC +DJW)YTY +X7L)R6J +YNN)G86 +ZPV)NYM +8KQ)5N5 +K1Y)D8G +SVK)M3R +ZZD)XBJ +5VS)M8V +5N5)JZK +D2V)Y8H +SZG)FMS +CG2)2S3 +2H4)9P8 +9XY)SMV +1YJ)3DT +932)NDV +3PK)PKW +8PD)T4Z +6C1)578 +6NK)2LL +NF1)H4Z +KC3)YQ2 +1F3)B9V +XLH)H1W +1RS)YQH +R3L)92R +COM)K9X +TTD)BNJ +4SV)5HZ +549)J2W +S96)4JG +88Z)TK7 +7D4)JPH +PYG)F76 +TSC)W23 +9Y6)48W +S7P)QMQ +15Y)NGF +82B)NL3 +2RH)BW5 +B8Y)MM1 +L6M)JRV +53V)S61 +K8G)7YW +N5S)VQ8 +W2H)WK7 +GS7)3ZK +WSD)965 +J2W)7FK +PNS)S6T +XHS)9LF +1Z3)WJ4 +7F3)8X9 +XRP)1KP +QGR)QNM +5CB)N5N +T21)F2F +FP2)XZ9 +7L8)BCH +B9W)KCL +XNB)JFV +H4Z)2V1 +C1N)DXF +LTF)918 +KMJ)WSW +CYN)Y7D +KG3)XNB +SGC)TXD +KPB)Q9J +Y4B)KNW +MBC)XY7 +XY1)717 +VTH)RXS +VK6)S96 +HP5)T6H +BMC)15Y +X6L)D2B +S99)P6L +642)HWZ +Q9J)V3G +QM5)457 +72F)TWN +YTS)K9N +VQ8)QXP +XN5)WMB +Z6B)1Z3 +JFV)HZB +NH6)4BY +8VF)RQT +1F3)BP7 +1LQ)WF3 +RTX)SVK +RV4)572 +61D)64D +SQY)XHJ +TFB)KMX +GD7)RRY +TJ1)FC4 +J5K)PYG +WLK)DGW +PYL)F58 +PY4)X61 +K5P)W32 +SMD)GSG +SY2)XLH +43L)XX5 +4DJ)NVS +GF5)T8J +R6J)T16 +6NG)W1R +LCS)6WZ +N9V)JBN +H9N)86Z +NS9)3MR +C2R)DLH +NM3)9H4 +YSL)CQC +N8X)GZ4 +XVG)Z9F +FPL)LXJ +PZH)ZJN +B9V)W2H +XDC)PNS +873)V82 +Q6L)S21 +P4R)642 +YQ2)QMR +C66)JJ2 +CFJ)FFQ +NDV)MDT +D44)5ZY +HND)B8B +P67)PCG +QC9)C58 +6Z5)3PK +N5N)CPY +6NG)N8P +6ND)LC7 +2RT)GBM +GWW)WJB +5DQ)3WS +5WD)1MM +SQY)1LM +STW)2HX +R2T)1S1 +8BP)XMG +VPM)PVP +HWR)858 +N8P)ZDH +3G2)4KC +T8J)5HL +VLG)WBL +ZKZ)QM5 +4L3)5PN +G9R)WYK +SH1)K2B +JRG)9MN +WBH)B7R +4FT)Y72 +LCX)VL5 +1H4)1XQ +DLH)848 +V3X)7F3 +CT7)SF7 +M6J)Q7R +5B4)YLH +SNN)XZQ +5GH)DV3 +GS7)JCZ +D9Q)CJX +MX8)172 +MG4)J73 +RQ3)9G6 +FJP)SC6 +SKW)NDP +1YN)T21 +1H3)GW2 +YBD)6PV +62J)MLK +BFG)GGS +GYR)P49 +6TQ)8Z3 +JSD)87S +V82)53V +HTQ)YNM +CJM)FHB +JBD)SQY +XY7)MPF +RN6)Q4W +VN9)2MT +3VM)61H +RN2)QGR +BV6)BLQ +3WG)XPY +B69)TGL +3VT)HG6 +BL2)M1P +1BV)2DW +75P)3WQ +9PN)CG2 +DGF)J78 +LQD)5GH +L2H)96B +XX5)82W +GYC)SGC +LYL)S9Z +HZB)D8R +K9N)6SH +6R3)S3N +NGJ)VB5 +QLL)SH1 +366)6Z5 +QRP)9XY +NL3)21Z +2G7)MJZ +P6L)RN2 +DSH)GBJ +VGQ)95P +N97)94D +BD2)X47 +T6H)VMN +G1R)B6D +B7R)R72 +K9X)1PX +NJ8)2RC +S9Z)ZM2 +HW5)FMT +FPJ)M5C +MST)1P9 +965)X32 +NX3)CGK +717)DR3 +1D2)TSC +RXH)H9N +8G2)HPL +D8G)XXT +5QT)4SX +1XS)NHG +M9V)PF2 +4FB)744 +8NP)5JW +LZM)H14 +J9C)484 +7TC)Z4B +Z27)1LQ +RKC)GVP +RQC)JBD +LVD)FKJ +GFD)HQB +8J9)1ZD +6SF)SAN +SC8)BK9 +VGT)JX7 +KCZ)4HT +K9L)MQN +9MY)LZ5 +JLP)WVP +HFV)Z7D +J1Z)LB6 +X61)T92 +WW6)VTH +KNC)NL4 +C4P)RSJ +QNM)TFB +N12)983 +3JJ)QR5 +LZ5)H84 +KTP)7JK +3WB)Q6L +MS9)YW7 +DXT)Y4W +3G9)LVC +2K1)1YJ +577)ZQT +7NP)Y47 +PVP)ZW3 +V3H)SSS +ZVM)ZZZ +1GF)ZYQ +HVX)R2D +J9G)4GZ +3FX)CX6 +97J)X4Z +WMB)M2K +9LF)B95 +QBJ)HF3 +JWB)292 +QRD)P42 +Q4W)RV4 +XPY)M5Y +5DQ)JGR +95S)GYM +T7M)SY2 +6GV)PNV +P5H)7YV +6XD)FVC +ZRP)LWH +BP7)W78 +6G4)741 +G2B)HTQ +F2Z)D6P +XZ9)XVG +T7M)1H4 +1X7)55J +94D)9ZH +HJ5)R2C +WSW)3VT +2JB)CLB +91G)GGG +S21)NJ8 +1Z3)5RP +15B)WXR +Q63)PMD +18C)C2R +97M)DQ4 +MRX)Y4D +82W)BBW +QR5)2P8 +CYN)H5F +WRJ)PWK +XCQ)3V1 +BFM)8LX +69M)HGF +LCC)9W8 +15Y)71S +WLF)CRR +MDT)549 +918)19W +J9B)82B +H6R)HL2 +2S3)1XS +5JW)6ND +WF3)NCP +XGX)5CH +6WZ)SHY +J67)P4B +VSR)J6N +9ZH)35Y +MRJ)DSH +86Z)X2H +TXW)WJ8 +3LQ)N8X +9H4)3LN +KK5)4SK +NHG)K4C +GYM)43L +XQ4)KDX +Z5D)DZY +H4Z)JBT +BK9)KYK +1KP)BV6 +44Y)T6V +T1T)TRH +95Q)XZ3 +47X)375 +PRB)MJX +VL5)FR1 +CGK)7RN +5CH)9BB +5WN)NVY +SKS)YVT +DV3)SM6 +63J)ZRP +7YV)GY7 +PKW)T3J +JRV)XQ4 +2WM)XWK +F5J)GF5 +5PL)5WN +LWH)J67 +WJY)N39 +N12)3WB +FLL)RB9 +T5J)J9B +FFQ)YD2 +R2D)SC8 +VX8)6G4 +VMN)PP3 +NDP)V3H +V8N)2XQ +8VL)GD7 +1S1)4F9 +GHT)8G2 +T8V)4T3 +DLC)MBC +1RS)VH1 +VN9)SMH +N39)RNN +W78)SCY +3F3)Z17 +8LX)ZQY +3VT)B11 +9BB)SP3 +D8R)NW1 +NGF)ZL8 +NVS)G2B +ZQY)4FY +BHQ)C99 +2KZ)HFV +D6P)NM3 +YTY)4DJ +6PV)61D +TK7)1WL +1VG)F7V +5JF)75P +XWK)LZZ +V7C)NXN +RSJ)XY1 +BCN)K5P +TCC)3YG +V4R)RHF +1P9)NHK +JJ2)CW6 +SCY)CYN +Z17)ZZD +VMQ)BV1 +XMG)44Y +H84)726 +R72)KMJ +546)WK5 +T4Z)QSH +CFX)WLF +JGR)TGZ +V7C)HXL +PBP)RB5 +KMX)7M7 +N65)MMS +XXN)9SV +VLN)422 +RTX)8MY +J6S)TTH +YGJ)4SV +FN9)59G +NYD)H5N +YW7)8WV +GNY)7NW +TYT)YZ4 +BL2)64L +HS7)P4R +XHJ)XDC +N5C)HND +CW6)W9W +8FF)3YH +HD3)Z6B +2J4)J9G +7G7)KM7 +S6T)BLD +WDK)Q63 +PJF)PH3 +ZGX)DJW +JBY)HCG +SMV)M9V +3ZN)B2X +RB5)VMQ +XXT)YBD +35Y)5BH +ZF1)LW1 +LTC)D44 +SHV)C41 +WJB)HD3 +MHV)VLG +W5L)FSQ +FVC)QTH +QR5)FLP +8MY)C6D +KDX)J6L +ZQT)95Q +SH1)WHY +BL4)JLP +VB3)RQ7 +GY7)ZGX +RH4)XNZ +D4Z)VFR +ZZZ)PDX +NM3)QTG +6CK)XRL +92R)XH1 +LBZ)SR8 +JNM)BTB +Q7R)FK8 +M2K)JV2 +457)1S6 +Q6L)B4Y +BC3)2G7 +VJN)6NK +B9W)CGL +WVP)BSF +HVP)VGK +9MN)879 +YLK)QVF +J2Q)QXJ +MLC)47X +NHK)DQY +9G9)18C +2X2)Z9M +375)QGC +572)F59 +YJD)RQC +X47)BFM +M14)N5S +S3N)6GC +4T3)C66 +4DJ)X5D +P36)W5K +H5Y)SF3 +WXJ)CT7 +BL5)ZVM +JTW)6GV +M1Z)17T +27Y)ZKQ +1XQ)TTF +LZQ)DPY +Z9F)J1X +NL4)X6L +LCC)HMV +RD6)KCZ +M1P)H6R +TKR)3VM +1WL)CSD +KCL)RVP +QGC)HC9 +V3G)Z5N +NSV)9MY +VFR)G1R +M5Y)VR9 +S9Z)KNC +YQH)N12 +K4C)T84 +4JG)T8V +SG5)JNM +79Z)V5L +PWK)MRJ +95Q)J5K +FXJ)FN9 +7D5)KGF +K2B)VD1 +QSN)4Q8 +PD7)SLF +BKX)WW5 +YGR)PWJ +LWM)XBL +XDY)3JJ +9VS)D76 +3WS)4BG +B11)F6P +94L)N42 +VTH)PD7 +9H9)N65 +YNL)2N6 +JV2)CJM +M5C)7G7 +RH4)W1P +64D)BD3 +FKJ)R2T +Z91)RXH +FJL)RXG +Y2M)DM4 +2F6)L6M +27Q)KG3 +9SQ)M6J +KMJ)Z27 +3ZK)CDV +3YH)1YN +SCX)NS9 +C6G)27Q +GQG)5CB +C6L)5C1 +MJZ)NP1 +BGT)C37 +NXN)P67 +ZL8)FKG +36P)JTW +LSR)X5S +2XQ)H1X +X58)L2H +G1T)HC7 +FLF)Z3L +XX5)7KZ +SLF)VVL +ZDH)TTQ +WK7)F5W +8XF)K1Y +87S)3BR +W2M)GHT +PF2)2YN +17T)HW5 +TSN)2X2 +Z4Y)BWY +J2L)PVY +76B)K68 +H5F)XM8 +TTQ)GWW +61H)MTP +JYF)C6L +MBC)BMC +PMD)TPP +MJX)CSP +LZ5)1QW +XBJ)FF9 +T2M)6TQ +53N)GS7 +2QY)VLN +RLG)72F +HC9)5NM +YBV)7N3 \ No newline at end of file diff --git a/aoc2019/input/day07.in b/aoc2019/input/day07.in new file mode 100644 index 0000000..0128ef0 --- /dev/null +++ b/aoc2019/input/day07.in @@ -0,0 +1 @@ +3,8,1001,8,10,8,105,1,0,0,21,46,59,84,93,110,191,272,353,434,99999,3,9,101,2,9,9,102,3,9,9,1001,9,5,9,102,4,9,9,1001,9,4,9,4,9,99,3,9,101,3,9,9,102,5,9,9,4,9,99,3,9,1001,9,4,9,1002,9,2,9,101,2,9,9,102,2,9,9,1001,9,3,9,4,9,99,3,9,1002,9,2,9,4,9,99,3,9,102,2,9,9,1001,9,5,9,1002,9,3,9,4,9,99,3,9,102,2,9,9,4,9,3,9,102,2,9,9,4,9,3,9,102,2,9,9,4,9,3,9,102,2,9,9,4,9,3,9,101,1,9,9,4,9,3,9,102,2,9,9,4,9,3,9,101,2,9,9,4,9,3,9,101,2,9,9,4,9,3,9,1001,9,1,9,4,9,3,9,101,2,9,9,4,9,99,3,9,102,2,9,9,4,9,3,9,1002,9,2,9,4,9,3,9,1002,9,2,9,4,9,3,9,1001,9,1,9,4,9,3,9,1001,9,2,9,4,9,3,9,101,1,9,9,4,9,3,9,1001,9,2,9,4,9,3,9,1002,9,2,9,4,9,3,9,1001,9,1,9,4,9,3,9,1001,9,2,9,4,9,99,3,9,101,1,9,9,4,9,3,9,1001,9,1,9,4,9,3,9,101,1,9,9,4,9,3,9,101,1,9,9,4,9,3,9,1002,9,2,9,4,9,3,9,1002,9,2,9,4,9,3,9,1002,9,2,9,4,9,3,9,1001,9,1,9,4,9,3,9,102,2,9,9,4,9,3,9,101,1,9,9,4,9,99,3,9,1001,9,1,9,4,9,3,9,102,2,9,9,4,9,3,9,101,1,9,9,4,9,3,9,1002,9,2,9,4,9,3,9,1001,9,2,9,4,9,3,9,101,1,9,9,4,9,3,9,1002,9,2,9,4,9,3,9,1002,9,2,9,4,9,3,9,1001,9,1,9,4,9,3,9,102,2,9,9,4,9,99,3,9,102,2,9,9,4,9,3,9,1002,9,2,9,4,9,3,9,1002,9,2,9,4,9,3,9,1001,9,1,9,4,9,3,9,101,1,9,9,4,9,3,9,102,2,9,9,4,9,3,9,1002,9,2,9,4,9,3,9,101,2,9,9,4,9,3,9,1002,9,2,9,4,9,3,9,1001,9,2,9,4,9,99 \ No newline at end of file diff --git a/aoc2019/input/day08.in b/aoc2019/input/day08.in new file mode 100644 index 0000000..9100e5b --- /dev/null +++ b/aoc2019/input/day08.in @@ -0,0 +1 @@ +112222222222222212222122220212222222202222222222222122222222202100222222120222101222222122222222221222220102222222222020222222212221222222222222221222102222222222222212222222220222222222202222222222222122222222222100222222120222121222222122222222221222221002222222222222222222202221222222222222222222022222222222222212222222220222222222202222222222222222222222222201222222120222010222222022222222221222220012222222222021222222212222222222222222221222112222222222222222222022222212222222222222222222222022222222202000222222021222021222222222222222221222220202222222222222222222202221222222222222222222212222222222222202222222222222222222222222222222222222222222212021222222021222001222222222222222222222222122222222222222222222222221222222222222221222222222222222222202222122222222222222202222212222222122222202212110222222222222220222222022222222220222221012222222222020222222222221222222222222220222022222222222222202222222221222222222222222212222202122222202202012222222222222220222222122222222222222222122222222222220222222222222222222222212220222112222222222222222222122221212222222222222202222212222222222222111222222121222121222222122222222220222222100222222222221222222212221222222222222221222022222222222222212222022222212222222212222202222222222222212122011222222222222002222222122222222222222220012222222222021222222222220222222222222220222022222222222220212222022222202222222202222212222201122222202222212222222222222102222222222222222222222222212222222222222222222212220222222222202221222002222222222222222222022220212222222212222212222220122222212022201222222121222100222222122222222220222222122222222222122222222202222222222222212222222002222222222222222222122222212222222222222222222222222222222102110222222221222101222222222222222220222221212222222222021222222202222222222222222221222202220222222220212222222222222222222212222202222211022222202022221222222222222001222222122222222021222220012222222222122222222212221222222222222222222212222222222221202222022221222222222222222212222200222222212012101222222021222200222222022222222120222222210222222222021222222212222222222222222220222002222222222221212222222220212222222202222222222212222222222202202222222221222100222222022222222220222222000222222222121222222212220222222222212221222112220222222221222222222222222222222212222212222222122222212122212212222221222010222222022222222022222222002222222222120222222202222222222222202222222222222222222221222222022221222222222212222202222212122222222122201212222120222101222222222222222222222221212222222222120222222222220222222222202220222022221222222222212222122220222222222212222212222212022222202222012222222120222000222222222222222121222222221222022222220222222222222222222222202221222002221222222222222222122222212222222202222012222211222222212112111212222122222020222222022222222022222221011222122222220222222212221222220222211221222112222222222221222222122221222222222222222102222211222222212002101202222020222111222222222022222122222222022222222222122222222222222222220222220222222202222222222220222222122221212222222202222222222222022222222202200222221021222220222221222122222122222221011222022222222222222202220222220222201222222112222222222221202222122222222222222222222012222210122222212012000202222121222011222221022220222020222220002222122222222222222222220222222222202020222002220222222222222222122221022222222202222222222220122222212102201222221022222221222221022022222222222220100202222222220222222202220222221202201221222022221222222220222222022220002222222202222202222210222222202022101202222220222120222221220021222021222221000212122222220222222212222222220222211122222002222222222220202222222221212222222222222102222221222222212002001202222021222011222220021121222222222220201212122222021222222212220222222222221220220022220222222221212222122222222222222222222102222222022222202112000222021022222011222222121220222121222220101222022222122222222212221222222212212122222022220222222121222222222220202222222222222012222210222222212222120222220221222222222221121121222220222220022212222222222222222222220222220202220020222202221212222020222222222221022222222212222112222202022222212212021202222021222202222220122221222120222220020112122222022222222200222222222222210120222022222202222021212222022222002202222222222222222221122222202112201212221020222200220221020120222022222220012212022222120222222212222222222212211122222012222212222020222222122221002212222212222102222222222222210002010212221221222211222221220121222222222220211102122222022222222220221222221222220122221222221212222022202222122222122222222202222012222211022222202222110222121122222112221221222222222121222220202122022222022222222220220222222212200020221202220222222221202222222220202222222222222022222211122222222222120212022221222120222222221120222122222222100222022222021222222201222222220222220220222022222212222120211222122220222212222202222222222202222222212212221202221221222021221220021220222022222222002112122222021222222211220222221222200122222212021202222122200222122220022202222202222222222211222222200122122212122220222112221220122122222120222222222102022222122202222220221222221202202220222102222212222022200222112220222212222212222212222220022222212012020202121120222212221222020220222120222221101122222222022212222210220222221202211222220022021202222222220222120222222202222202222012222210222222210212021212021120222102220222222220222120222221000122122222220202222222020222222212222021222112022212222221202222021222102220222212222022222221022222222202102212021121222101222222120021222122222222212122122222021202222210022222222222212220222112021202222122201222101222212202222202222102222211022222210012010212120222222121221222121021222022222222002112022222222212202200222222222222210222220012121212222120202222012221102212222201222212222212122222220122101212221222222212222222020222222122222221122212022222121212222211221222222222220120222222220222222120221222200221112211222212222112222211122222220222010222121220222211220220120021222022222220021222222222020212212210221222221202222122222012220202222221211222212220202211222201222112222212122222202112222222121122222220222222120120222021222222001212122222021212212200121222221212200022222222020202222020222222100220112221222200222022222221222222200012010212221120222200222222220121222221222222211022222222222202222221122222221212210221220222120212222121200222100220202211222200222022122212122222222122100212121120122212221221021122222020222222102202222222022202222210121222220212200220222122221222222222200222110222012201222222222002022211122222211222001222021022122101220220221120222021222222200112122222020212212210020222220222212122221222220202222020212222010221122202222220222022222220022222221122221212120021122222221222220020222021222220010012222222022202212221121222220222201122220212221212222020211122202220112200222201222112022201222222202102022212021020122021222220222221222021222221000102022222120212222220021222221222222121220102022202222020202222000220002211222221222002022220022222201022112222122121222102220221120121222120222221201212122222222212202220022222222221200022222222222222222022212122211221112222222222222012022222222222220122120212122021022202220222220220222122222222210212122222122212222212021222200220201021222202120222222022221222212220222210222212222202122211222222212002001202022222022200220220222120222021222221222002122222122212222221221222221201211221221012220222221220200122212212102210222210222212122221122222212122101212122022022211221221122122222222222222200012102222020212212221221222202210211221221022021202220022220222101202222211222221222002122211222222202122100212221122022001220222122221222121222221020212002222122222212202222222201222210221220001221212221022221222201211222211222202222122222211222222222122202212121121122010220221222121222021222220201012212222220212212211220222211212202220222221022202222220220122101202022221222221222122222201022222200002202212220021222000222222021220222102222222202202102222120222212211222222201211210021222211120222221021221122120220222220222210222012222201022222221202121222020122122201220021120221222211222220122212122222220212222201221222210200211220222111020212221222211122000220002210222212222202002201222222201222202222222020222011221021120222222211222221120002222222022202222210222222201210201122220001222222221020202122020202022212222201202002012202222222200002101212122121222012220022022120222120222220110102002222122212202211022222220210200220221222121222222220212122020212112220222221212102102212022222210212221202122221022021220021021221222010222222011102222222221202212212020222222202201221221211222202221020201022120202102201222210212202222212122222201222011212121222122201222120220220222121222221210002112222220222202222022222211212221121222101121222222120200222202201012222222201212002012210222222221002111202021221122000222220020121222020222220122202022222020222212211121122211222222220222020220202221120221222111212022221222201212112122222022222221022100222122122122222222122022220222222222220002202212222222212202221222022210221222022220212121222222022222122201222122212222202202212202221122222211102112202222020022002222121221022022200220221020011202222121212212200121122200210202222222111220222220222200022112212002211222200222122202211022222212120211222221220022020220022221021222011222221120011002222021212212222222222210220221121221020222212221022220122000202102201222221212002122212122222001012121202122222022001222220022121022201222020200212112222020202222210021122212212210221222000221222221222202022122200222200222221222222212220222222200000012212120021122210222020120221222202221021000022102222220212112201122022222202201022222211222212222221222122221212112222222220212112212212022222112212011222122220122120222221220022022110221020111000112222120202222202021022221202200022220000220222220222221122122222002222222212212022112221122222201112210212220122222212222020222112222022221122122010222222120222012220121122211212200122220212222202220020202022210212022210222201222222122222022222011002011202120222122211221221222211102101221121202220102222122212212221222122210200202220221010122210220020201022020212122202222212202222212222222222001022201212022020222102220021122201221011221222212010002222220202002200021222201210221121220110221210221020211222012202102201222200212102212222122222212221001202021022122211222020122111221110220021212222012222221212212210020222212201200122221200222211222120212122122201222210222202222222002202222222222001222222121221022020222221022121021110220122211000122222121222011211022222221221111020222011120220220020221022020222212212222222212002212200022222221002221212220021022021222220022222000200222020100202002222200212002200220022220202201220222222021222220221210122101222102220222202212212102201122222002020012222022222202012221221222122121120221021112221212212001222000211220022222212002121220010121212220220201222020220012212222210222102022221022222221101021212021021122122222121222222101101222120110110112212010102111220222222202212011020222212222111222221210122020221212220222211202110022221222222102011120212120020102120221222222111121220222120011112002202010122212222220222201200112021200112121120220020201022110200002202222211222200022220122222200220111212021122012012221221222000211012221021201122212222022022012212022022200202012222212201022210221220211022102210112212222220222200012201222222011120101212022121022002220122121212122002221122101110202212110112012210122022201212210112212110121221222021212022200201102200222211202200022220222222000210201202020021010002222020021201101220220122201220202222102102021212120122211201001112212020122110221022220122122220012212222211202200212212022222022202222222121221202122221220222011000012222221212020212202222212202200221022201221111000200000220002220200210122221222012202222211212000202222222222021201101202122122020222220120221112200121210020210101122212201012021210221122200211102212200012020200220220222022111212202211222222222222212202122222111202022222222121021111220220120001220120222021211200002222000022000202221222210210220101220102021110220112200221122210212212222220222012112220122222112020110222220121121211202020022111000100211022112020212212121102022212222122202222220201212002022012222002202020010222212212202202202222212212022222010210101202122020002101222022122202022121222120220100102212120012020220020222201201000211211120120112222202212222021021112220202202202120022212022222021111220202222022222121201022120201010212211122121202002212121222222222022022202221021010201111201200220112201122220010222210222202222102012222222222112020002222020121220221221021221211212021202121021100022212020212210212122122201220120000211202201121222101222220202122002210222210202221222202222222221210001212022120221222211020022022001002220220222000012202021002020200222022210221011220200101202012220220202221201020122220222222202202112220222222102121221212122021100121210020122112201210220021120012002202101002002220220222212201022100221122220011210011222021020201022211222200212121112200022022002210100212222022122000200021120110212011200220001020202212022122122202220222211002022220200122020122200001212021200110202212222212212001212222022222000200101222010221210201211021022111100001221120221201212212222202211220121022221001121111221222212011200110202120121001202200212222202212202212122022100010012222211121110001202022222120022020221222002202002222011102212200220022210111202010210122212200211000102021001010202220222202202100222220122022100112200212211122012202011020220102021210202020221000222202020212201210022122202012211212211010011200211002020122110021022202202222222211112211222222000102010222222221112210211122122022112122222020001002212222101102221201021222210201010220221011022102202110221221022010222222222221212022102221222022120111002202210022121121100221121221000120212022212121112212220112010212222222211020222010202112201010212110001220102211222220222210202210112221122212201222200212112221120220212020221201100210210120111020112212100112201211020122222020211220200002101012201211122221022201012201202212222102112221022102021100112212201021102002011222120220200200202022110012122202000212202220221122211020011012210022000121200121200122202011212220212212212222222202022022000220022212102221100111101221120002111210000122201220212202100002202202022022201110201021222110120202222000012021211021122212221220202201022201122122001201022212210220121002000020121212020022021221222111012202210102211201121022210002120001220212020012210020222021120121222220221201222102002202222022000201001222122220222210010222022102200120202220002201102212001112012210200022220101122102202111121121210100220221020012212200210212202111212201022012201010020202201020202110002122220211200202212021001110022202001022022220201122212012010111210101002020222011112222111210122200220012220220002210222222001012120222112121012001112021121202212121112121012112112212210002010210222222202111200210211202121012002102000101211111010100120221012202200121110120121110120020121100021222100011001001200112000212100001000010102120220120002000122100001220102 diff --git a/aoc2019/input/day09.in b/aoc2019/input/day09.in new file mode 100644 index 0000000..0e05ddc --- /dev/null +++ b/aoc2019/input/day09.in @@ -0,0 +1 @@ +1102,34463338,34463338,63,1007,63,34463338,63,1005,63,53,1101,0,3,1000,109,988,209,12,9,1000,209,6,209,3,203,0,1008,1000,1,63,1005,63,65,1008,1000,2,63,1005,63,904,1008,1000,0,63,1005,63,58,4,25,104,0,99,4,0,104,0,99,4,17,104,0,99,0,0,1101,0,252,1023,1101,0,0,1020,1102,1,39,1013,1102,1,234,1029,1102,26,1,1016,1101,37,0,1005,1101,0,27,1011,1101,21,0,1000,1101,0,29,1019,1101,35,0,1003,1102,22,1,1007,1102,1,32,1001,1101,1,0,1021,1102,1,216,1027,1102,30,1,1012,1102,1,24,1009,1101,36,0,1002,1101,0,31,1010,1101,0,243,1028,1102,787,1,1024,1102,255,1,1022,1102,33,1,1017,1102,1,23,1004,1102,778,1,1025,1102,1,28,1008,1101,0,223,1026,1102,1,25,1015,1101,0,20,1006,1102,34,1,1014,1101,38,0,1018,109,-4,1202,5,1,63,1008,63,32,63,1005,63,203,4,187,1106,0,207,1001,64,1,64,1002,64,2,64,109,37,2106,0,-6,1001,64,1,64,1106,0,225,4,213,1002,64,2,64,109,3,2106,0,-8,4,231,1001,64,1,64,1105,1,243,1002,64,2,64,109,-12,2105,1,-1,1105,1,261,4,249,1001,64,1,64,1002,64,2,64,109,-13,2102,1,-3,63,1008,63,31,63,1005,63,285,1001,64,1,64,1106,0,287,4,267,1002,64,2,64,109,6,21102,40,1,0,1008,1017,40,63,1005,63,313,4,293,1001,64,1,64,1105,1,313,1002,64,2,64,109,-10,2107,31,-6,63,1005,63,331,4,319,1105,1,335,1001,64,1,64,1002,64,2,64,109,-6,2102,1,7,63,1008,63,28,63,1005,63,357,4,341,1105,1,361,1001,64,1,64,1002,64,2,64,109,2,21107,41,40,8,1005,1011,377,1106,0,383,4,367,1001,64,1,64,1002,64,2,64,109,-1,1201,2,0,63,1008,63,26,63,1005,63,403,1106,0,409,4,389,1001,64,1,64,1002,64,2,64,109,22,1205,-4,425,1001,64,1,64,1105,1,427,4,415,1002,64,2,64,109,-9,21101,42,0,3,1008,1018,39,63,1005,63,451,1001,64,1,64,1105,1,453,4,433,1002,64,2,64,109,3,21107,43,44,0,1005,1018,475,4,459,1001,64,1,64,1105,1,475,1002,64,2,64,109,-7,21101,44,0,0,1008,1011,44,63,1005,63,497,4,481,1105,1,501,1001,64,1,64,1002,64,2,64,109,17,1206,-7,513,1105,1,519,4,507,1001,64,1,64,1002,64,2,64,109,-24,1207,5,25,63,1005,63,537,4,525,1105,1,541,1001,64,1,64,1002,64,2,64,109,7,21108,45,43,2,1005,1013,557,1106,0,563,4,547,1001,64,1,64,1002,64,2,64,109,-5,1207,-3,34,63,1005,63,583,1001,64,1,64,1106,0,585,4,569,1002,64,2,64,109,5,21108,46,46,5,1005,1016,607,4,591,1001,64,1,64,1105,1,607,1002,64,2,64,109,-12,2108,20,8,63,1005,63,627,1001,64,1,64,1105,1,629,4,613,1002,64,2,64,109,24,1206,-3,647,4,635,1001,64,1,64,1105,1,647,1002,64,2,64,109,-30,2108,32,8,63,1005,63,665,4,653,1106,0,669,1001,64,1,64,1002,64,2,64,109,22,1208,-9,20,63,1005,63,691,4,675,1001,64,1,64,1106,0,691,1002,64,2,64,109,-4,21102,47,1,3,1008,1014,49,63,1005,63,715,1001,64,1,64,1105,1,717,4,697,1002,64,2,64,109,-10,2101,0,1,63,1008,63,36,63,1005,63,743,4,723,1001,64,1,64,1105,1,743,1002,64,2,64,109,16,1201,-9,0,63,1008,63,28,63,1005,63,769,4,749,1001,64,1,64,1105,1,769,1002,64,2,64,109,2,2105,1,5,4,775,1001,64,1,64,1106,0,787,1002,64,2,64,109,-5,1202,-6,1,63,1008,63,26,63,1005,63,807,1106,0,813,4,793,1001,64,1,64,1002,64,2,64,109,-16,2107,37,4,63,1005,63,833,1001,64,1,64,1105,1,835,4,819,1002,64,2,64,109,2,2101,0,1,63,1008,63,34,63,1005,63,855,1105,1,861,4,841,1001,64,1,64,1002,64,2,64,109,19,1205,2,875,4,867,1105,1,879,1001,64,1,64,1002,64,2,64,109,-2,1208,-8,23,63,1005,63,899,1001,64,1,64,1106,0,901,4,885,4,64,99,21101,0,27,1,21102,915,1,0,1106,0,922,21201,1,61455,1,204,1,99,109,3,1207,-2,3,63,1005,63,964,21201,-2,-1,1,21102,942,1,0,1105,1,922,22102,1,1,-1,21201,-2,-3,1,21102,1,957,0,1105,1,922,22201,1,-1,-2,1106,0,968,22101,0,-2,-2,109,-3,2105,1,0 \ No newline at end of file diff --git a/aoc2019/input/day10.in b/aoc2019/input/day10.in new file mode 100644 index 0000000..bf4ecf6 --- /dev/null +++ b/aoc2019/input/day10.in @@ -0,0 +1,24 @@ +##.##..#.####...#.#.#### +##.###..##.#######..##.. +..######.###.#.##.###### +.#######.####.##.#.###.# +..#...##.#.....#####..## +#..###.#...#..###.#..#.. +###..#.##.####.#..##..## +.##.##....###.#..#....#. +########..#####..####### +##..#..##.#..##.#.#.#..# +##.#.##.######.#####.... +###.##...#.##...#.###### +###...##.####..##..##### +##.#...#.#.....######.## +.#...####..####.##...##. +#.#########..###..#.#### +#.##..###.#.######.##### +##..##.##...####.#...##. +###...###.##.####.#.##.. +####.#.....###..#.####.# +##.####..##.#.##..##.#.# +#####..#...####..##..#.# +.##.##.##...###.##...### +..###.########.#.###..#. \ No newline at end of file diff --git a/aoc2019/input/day11.in b/aoc2019/input/day11.in new file mode 100644 index 0000000..693f432 --- /dev/null +++ b/aoc2019/input/day11.in @@ -0,0 +1 @@ +3,8,1005,8,350,1106,0,11,0,0,0,104,1,104,0,3,8,1002,8,-1,10,101,1,10,10,4,10,1008,8,1,10,4,10,102,1,8,29,1006,0,82,1006,0,40,3,8,1002,8,-1,10,101,1,10,10,4,10,1008,8,0,10,4,10,1002,8,1,57,1,102,15,10,1,1005,14,10,1006,0,33,3,8,102,-1,8,10,101,1,10,10,4,10,1008,8,0,10,4,10,102,1,8,90,1,1008,14,10,2,3,19,10,1006,0,35,1006,0,21,3,8,102,-1,8,10,1001,10,1,10,4,10,108,1,8,10,4,10,1002,8,1,125,1,1105,11,10,2,1105,9,10,1,4,1,10,2,1,4,10,3,8,1002,8,-1,10,101,1,10,10,4,10,1008,8,0,10,4,10,101,0,8,164,1006,0,71,3,8,102,-1,8,10,101,1,10,10,4,10,1008,8,0,10,4,10,1002,8,1,189,1006,0,2,1,5,17,10,1006,0,76,1,1002,7,10,3,8,1002,8,-1,10,101,1,10,10,4,10,108,1,8,10,4,10,1001,8,0,224,1,3,5,10,3,8,1002,8,-1,10,101,1,10,10,4,10,108,1,8,10,4,10,101,0,8,250,1,1,20,10,1,102,13,10,2,101,18,10,3,8,1002,8,-1,10,101,1,10,10,4,10,108,0,8,10,4,10,102,1,8,284,2,105,0,10,1,105,20,10,3,8,1002,8,-1,10,101,1,10,10,4,10,1008,8,1,10,4,10,1002,8,1,315,1006,0,88,1,2,4,10,2,8,17,10,2,6,2,10,101,1,9,9,1007,9,1056,10,1005,10,15,99,109,672,104,0,104,1,21102,1,847069688728,1,21101,0,367,0,1106,0,471,21102,386577216404,1,1,21102,378,1,0,1105,1,471,3,10,104,0,104,1,3,10,104,0,104,0,3,10,104,0,104,1,3,10,104,0,104,1,3,10,104,0,104,0,3,10,104,0,104,1,21101,97952923867,0,1,21102,425,1,0,1106,0,471,21101,0,29033143319,1,21102,436,1,0,1105,1,471,3,10,104,0,104,0,3,10,104,0,104,0,21102,1,868410614628,1,21101,0,459,0,1105,1,471,21101,837896909672,0,1,21101,0,470,0,1105,1,471,99,109,2,22102,1,-1,1,21101,40,0,2,21102,502,1,3,21102,492,1,0,1106,0,535,109,-2,2105,1,0,0,1,0,0,1,109,2,3,10,204,-1,1001,497,498,513,4,0,1001,497,1,497,108,4,497,10,1006,10,529,1102,1,0,497,109,-2,2105,1,0,0,109,4,2101,0,-1,534,1207,-3,0,10,1006,10,552,21101,0,0,-3,22101,0,-3,1,22101,0,-2,2,21102,1,1,3,21101,571,0,0,1106,0,576,109,-4,2106,0,0,109,5,1207,-3,1,10,1006,10,599,2207,-4,-2,10,1006,10,599,21202,-4,1,-4,1105,1,667,21202,-4,1,1,21201,-3,-1,2,21202,-2,2,3,21102,1,618,0,1106,0,576,21201,1,0,-4,21101,0,1,-1,2207,-4,-2,10,1006,10,637,21102,0,1,-1,22202,-2,-1,-2,2107,0,-3,10,1006,10,659,21202,-1,1,1,21101,659,0,0,106,0,534,21202,-2,-1,-2,22201,-4,-2,-4,109,-5,2105,1,0 diff --git a/aoc2019/input/day12.in b/aoc2019/input/day12.in new file mode 100644 index 0000000..071ed71 --- /dev/null +++ b/aoc2019/input/day12.in @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/aoc2019/input/day13.in b/aoc2019/input/day13.in new file mode 100644 index 0000000..bb41b45 --- /dev/null +++ b/aoc2019/input/day13.in @@ -0,0 +1 @@ +1,380,379,385,1008,2617,649812,381,1005,381,12,99,109,2618,1101,0,0,383,1102,1,0,382,21001,382,0,1,21002,383,1,2,21102,37,1,0,1106,0,578,4,382,4,383,204,1,1001,382,1,382,1007,382,43,381,1005,381,22,1001,383,1,383,1007,383,23,381,1005,381,18,1006,385,69,99,104,-1,104,0,4,386,3,384,1007,384,0,381,1005,381,94,107,0,384,381,1005,381,108,1105,1,161,107,1,392,381,1006,381,161,1101,-1,0,384,1105,1,119,1007,392,41,381,1006,381,161,1101,0,1,384,21001,392,0,1,21101,0,21,2,21102,0,1,3,21102,1,138,0,1106,0,549,1,392,384,392,21001,392,0,1,21102,21,1,2,21102,1,3,3,21102,161,1,0,1105,1,549,1101,0,0,384,20001,388,390,1,20101,0,389,2,21102,1,180,0,1106,0,578,1206,1,213,1208,1,2,381,1006,381,205,20001,388,390,1,20101,0,389,2,21102,205,1,0,1105,1,393,1002,390,-1,390,1102,1,1,384,21002,388,1,1,20001,389,391,2,21101,228,0,0,1105,1,578,1206,1,261,1208,1,2,381,1006,381,253,20102,1,388,1,20001,389,391,2,21102,1,253,0,1105,1,393,1002,391,-1,391,1101,0,1,384,1005,384,161,20001,388,390,1,20001,389,391,2,21101,0,279,0,1106,0,578,1206,1,316,1208,1,2,381,1006,381,304,20001,388,390,1,20001,389,391,2,21101,304,0,0,1106,0,393,1002,390,-1,390,1002,391,-1,391,1101,0,1,384,1005,384,161,20102,1,388,1,21002,389,1,2,21102,0,1,3,21101,0,338,0,1105,1,549,1,388,390,388,1,389,391,389,21002,388,1,1,20102,1,389,2,21102,4,1,3,21101,0,365,0,1106,0,549,1007,389,22,381,1005,381,75,104,-1,104,0,104,0,99,0,1,0,0,0,0,0,0,361,19,18,1,1,21,109,3,21201,-2,0,1,22101,0,-1,2,21101,0,0,3,21101,0,414,0,1106,0,549,21201,-2,0,1,22102,1,-1,2,21102,429,1,0,1105,1,601,2102,1,1,435,1,386,0,386,104,-1,104,0,4,386,1001,387,-1,387,1005,387,451,99,109,-3,2106,0,0,109,8,22202,-7,-6,-3,22201,-3,-5,-3,21202,-4,64,-2,2207,-3,-2,381,1005,381,492,21202,-2,-1,-1,22201,-3,-1,-3,2207,-3,-2,381,1006,381,481,21202,-4,8,-2,2207,-3,-2,381,1005,381,518,21202,-2,-1,-1,22201,-3,-1,-3,2207,-3,-2,381,1006,381,507,2207,-3,-4,381,1005,381,540,21202,-4,-1,-1,22201,-3,-1,-3,2207,-3,-4,381,1006,381,529,21202,-3,1,-7,109,-8,2105,1,0,109,4,1202,-2,43,566,201,-3,566,566,101,639,566,566,1202,-1,1,0,204,-3,204,-2,204,-1,109,-4,2106,0,0,109,3,1202,-1,43,593,201,-2,593,593,101,639,593,593,21002,0,1,-2,109,-3,2106,0,0,109,3,22102,23,-2,1,22201,1,-1,1,21101,0,499,2,21101,0,275,3,21101,0,989,4,21101,630,0,0,1105,1,456,21201,1,1628,-2,109,-3,2105,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,2,2,2,0,2,2,2,2,2,2,0,2,2,0,2,2,2,2,2,0,2,0,2,2,0,0,0,0,2,2,2,2,2,0,0,0,2,2,0,1,1,0,0,0,0,0,0,2,0,2,0,2,2,0,2,0,0,2,0,2,2,2,0,2,2,2,2,0,2,0,2,2,2,2,2,0,2,0,2,2,2,0,1,1,0,2,0,2,0,0,2,2,0,2,0,2,2,2,2,2,0,2,0,0,2,2,2,2,2,2,2,2,2,0,0,0,0,2,0,2,2,2,2,2,0,1,1,0,2,2,2,2,2,0,2,2,2,2,2,0,2,2,2,2,2,2,0,0,0,0,2,2,0,0,0,2,2,2,0,0,0,0,2,0,0,2,0,0,1,1,0,2,2,2,2,0,0,2,2,2,2,2,2,2,0,0,0,0,2,0,2,2,2,2,0,0,2,0,0,2,0,0,2,2,2,2,0,0,2,2,0,1,1,0,2,2,2,0,2,2,0,0,2,2,0,2,2,2,0,0,2,0,2,2,0,2,0,2,2,2,2,2,2,0,2,2,2,2,2,2,0,2,2,0,1,1,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,0,0,0,2,2,2,2,0,2,2,2,2,0,2,2,2,2,2,2,0,1,1,0,0,0,0,2,0,2,2,0,2,2,2,0,0,0,2,0,0,2,0,2,0,2,2,2,0,2,0,2,2,2,2,2,2,0,2,2,0,2,0,0,1,1,0,2,2,2,2,2,0,2,0,0,2,0,2,2,0,2,0,2,2,2,0,2,2,2,0,2,0,0,2,0,2,2,0,2,0,2,0,2,2,2,0,1,1,0,2,2,2,0,0,2,2,2,2,0,2,0,0,0,2,0,0,2,2,2,0,0,2,0,2,0,2,2,2,2,0,2,0,2,0,2,0,0,2,0,1,1,0,2,2,2,2,2,0,0,2,2,0,0,0,2,0,2,0,2,0,0,2,0,0,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,0,1,1,0,2,2,2,0,2,0,0,2,0,0,2,0,2,2,0,0,2,0,2,2,0,2,2,2,2,2,0,2,0,0,2,2,2,0,2,0,2,0,2,0,1,1,0,2,2,2,2,2,2,0,2,0,0,2,2,2,0,2,2,0,2,0,0,2,0,0,0,0,2,2,0,0,2,0,0,2,0,0,0,0,2,2,0,1,1,0,2,2,2,2,2,2,0,2,0,0,0,0,0,2,0,0,0,2,2,2,2,0,2,0,2,0,0,0,0,2,0,0,2,2,2,0,0,0,2,0,1,1,0,0,2,0,0,2,0,2,0,2,2,2,0,2,0,2,0,2,2,2,0,0,2,2,0,2,0,0,0,2,2,2,0,0,0,2,2,2,2,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,50,83,69,55,5,36,88,27,48,45,55,26,23,56,75,93,20,97,93,90,50,24,84,49,93,23,74,88,42,37,31,74,42,93,56,81,50,48,64,26,80,53,72,51,63,25,30,74,85,93,5,1,78,10,85,22,20,18,92,98,97,29,52,22,67,48,79,50,19,64,11,1,29,71,44,32,19,30,36,73,78,28,13,42,33,74,56,38,1,55,94,9,53,16,26,24,75,3,17,67,18,19,7,56,61,22,71,85,2,24,80,20,6,33,12,67,38,81,41,59,81,38,17,7,61,10,77,36,96,85,10,71,76,68,90,62,93,16,83,61,59,42,83,81,10,94,35,38,66,27,61,26,61,61,65,1,42,65,83,30,23,96,39,87,30,38,47,97,48,77,38,23,23,26,36,58,77,33,44,23,21,49,72,7,46,73,43,86,8,71,92,43,16,1,72,40,55,10,74,5,84,24,92,24,10,47,7,49,9,23,6,80,18,78,88,50,31,56,45,35,74,62,68,74,45,78,5,20,75,83,72,13,59,66,76,63,49,97,54,9,16,32,39,7,45,16,32,57,71,18,80,90,54,8,27,53,5,10,2,74,79,34,2,76,21,80,75,62,88,46,32,26,5,1,60,14,73,60,7,69,93,36,4,63,94,89,2,55,30,5,7,28,71,72,45,44,3,98,43,42,28,63,69,52,61,67,79,80,55,1,39,1,58,6,82,64,81,11,16,41,50,23,31,94,98,75,96,94,40,98,97,20,88,94,64,17,61,60,63,26,76,87,73,80,30,15,61,90,61,16,41,86,52,67,90,58,85,33,29,59,92,45,10,82,22,65,62,43,14,92,47,17,25,15,55,55,25,70,52,63,86,73,86,34,43,7,2,94,93,13,73,28,88,23,12,82,16,79,56,36,32,52,62,82,81,57,39,88,70,25,50,14,80,52,56,11,81,14,15,83,36,84,76,74,21,19,56,1,29,44,68,87,42,68,92,54,13,76,48,48,66,89,49,64,32,59,53,30,57,20,94,72,42,2,77,7,56,54,27,17,67,67,56,94,8,58,28,81,9,72,64,20,95,92,7,61,7,46,44,2,81,17,78,7,32,64,40,17,47,62,57,19,61,36,88,10,71,6,88,39,43,48,2,50,30,20,39,75,9,46,78,17,56,88,96,20,50,7,14,12,67,7,23,77,94,58,44,96,65,48,44,60,52,65,88,39,45,13,63,37,16,2,26,41,95,73,45,37,29,35,82,30,14,90,18,29,33,92,23,63,51,79,17,86,76,83,85,20,43,48,51,28,94,50,77,74,90,5,33,52,47,14,76,70,3,59,28,95,78,82,1,6,59,97,38,68,60,68,95,31,98,8,32,71,70,25,47,76,75,13,35,60,19,45,7,49,34,61,93,21,79,81,52,17,82,28,69,35,72,10,12,55,25,45,9,67,60,67,27,97,26,13,30,4,6,64,34,36,88,19,90,50,35,32,6,38,15,18,88,10,42,68,71,31,29,45,90,50,85,13,69,80,91,4,21,81,18,21,38,44,42,49,54,47,61,43,17,54,89,47,13,27,6,67,96,54,80,54,85,32,1,39,18,28,98,55,30,2,90,43,9,48,43,54,42,21,3,50,49,2,47,23,51,2,66,88,80,24,66,31,28,68,15,93,34,55,69,86,92,16,13,69,26,78,20,84,16,87,1,51,91,65,89,70,31,28,48,28,81,54,40,81,77,25,64,98,41,46,30,50,9,33,58,24,31,62,41,92,4,40,12,53,32,50,62,78,80,36,90,36,47,9,34,13,91,36,74,82,60,31,74,77,33,16,79,10,68,56,52,43,71,76,31,65,14,68,49,73,36,55,76,48,37,3,33,85,8,42,92,44,66,22,84,54,98,50,8,21,70,63,89,53,21,20,72,9,46,38,27,20,76,66,57,15,73,23,34,36,38,46,53,76,86,45,75,50,27,25,81,80,68,95,73,12,89,58,15,30,79,63,35,62,53,15,27,64,89,21,58,65,80,16,92,64,29,89,16,71,23,68,46,30,17,41,67,4,16,84,25,9,78,46,18,85,3,26,32,12,45,49,79,11,4,65,82,17,21,29,60,1,20,16,93,72,7,17,88,67,75,3,24,73,73,71,54,35,95,57,80,16,7,44,8,58,83,68,87,21,41,90,7,85,32,22,41,23,47,30,56,94,27,50,65,62,36,74,51,39,21,36,44,47,96,15,59,72,97,84,25,649812 \ No newline at end of file diff --git a/aoc2019/input/day14.in b/aoc2019/input/day14.in new file mode 100644 index 0000000..438d38f --- /dev/null +++ b/aoc2019/input/day14.in @@ -0,0 +1,61 @@ +8 LHFV => 3 PMVMQ +2 ZXNM, 1 PSVLS, 4 GRDNT, 26 GLZH, 3 VHJX, 16 BGPF, 1 LHVTN => 4 BTQL +10 NKHSG, 20 FCPC, 11 GRDNT => 5 HDJB +6 WPZN, 1 LHFV => 7 BGPF +1 WDXT, 1 PLCNZ => 3 QHFKR +12 LCHZ => 1 TPXCK +11 LSNG => 4 XFGH +195 ORE => 4 GRNC +8 XFGQ => 1 GRDNT +1 FBRG => 5 LCHZ +7 XZBJ, 8 RSZF, 9 SVDX => 9 LWDP +20 WDXT => 5 RQFRT +1 LXQWG, 1 GLZH => 6 SDLJ +4 XFGH => 1 GCZLZ +1 WPZN => 1 FBRG +19 XZBJ => 5 WXGV +1 GDXC => 6 WDXT +1 WXGV, 1 NKHSG, 2 LWDP => 5 FCNPB +4 LWDP, 5 BGPF => 9 KLRB +1 GMRN => 4 GLZH +1 RQFRT => 5 SVDX +2 HWKG => 7 LHFV +2 LCHZ, 13 JTJT, 10 TPXCK => 3 RSZF +29 MZTVH => 6 TSGR +9 NRFLK, 1 SVDX => 5 NKHSG +123 ORE => 9 GDXC +1 PZPBV, 21 PMVMQ, 1 GCZLZ => 8 SKZGB +3 GRNC, 5 GDXC => 8 QZVM +6 VTDQ, 13 TCQW, 3 FCNPB, 48 PSVLS, 3 RLNF, 73 BTQL, 5 MHRVG, 26 BGPF, 26 HDJB, 5 XFGQ, 6 HTFL => 1 FUEL +5 QZVM, 2 JTJT => 1 PXKHG +3 LSNG, 1 PMVMQ => 8 VTDQ +31 XFGH => 1 FCPC +9 PSVLS => 8 FWGTF +1 GRNC => 3 WPZN +16 JBXDX, 4 GRNC => 6 HWKG +1 SKZGB, 5 RSZF => 4 XZBJ +134 ORE => 9 CTDRZ +1 SVDX, 2 TPXCK => 7 JTJT +6 RQFRT, 4 KBCW => 3 BGNLR +12 KLRB, 12 LHFV => 4 HTFL +2 GMRN => 6 XFGQ +16 WNSW, 12 SKZGB => 8 LXQWG +2 NRFLK, 2 CTDRZ => 9 JBXDX +1 PZPBV => 8 RLNF +2 JTJT, 5 GCZLZ => 3 WNSW +5 WXGV, 2 LCHZ => 2 SCDS +1 QHFKR => 3 GMRN +10 JTJT, 2 HRCG => 8 KBCW +7 HWKG => 4 PSVLS +7 WNSW, 1 PXKHG, 3 BGNLR => 9 MZTVH +15 TPXCK, 11 LHFV => 5 HRCG +1 LSNG, 1 HWKG => 3 PZPBV +7 BGPF => 9 PLCNZ +1 ZGWT => 6 ZXNM +26 NKHSG, 1 LHFV, 2 JTJT, 26 WXGV, 6 SDLJ, 1 KLRB, 1 TSGR => 8 TCQW +154 ORE => 4 NRFLK +1 GMRN => 3 VHJX +5 QZVM, 3 GDXC => 7 LSNG +5 WNSW => 5 ZGWT +6 QHFKR, 8 PZPBV, 10 FBRG, 13 FWGTF, 1 LHVTN, 4 SCDS, 8 VHJX, 7 TSGR => 6 MHRVG +12 GLZH => 5 LHVTN \ No newline at end of file diff --git a/aoc2019/input/day15.in b/aoc2019/input/day15.in new file mode 100644 index 0000000..79901fe --- /dev/null +++ b/aoc2019/input/day15.in @@ -0,0 +1 @@ +3,1033,1008,1033,1,1032,1005,1032,31,1008,1033,2,1032,1005,1032,58,1008,1033,3,1032,1005,1032,81,1008,1033,4,1032,1005,1032,104,99,1002,1034,1,1039,1001,1036,0,1041,1001,1035,-1,1040,1008,1038,0,1043,102,-1,1043,1032,1,1037,1032,1042,1105,1,124,1001,1034,0,1039,102,1,1036,1041,1001,1035,1,1040,1008,1038,0,1043,1,1037,1038,1042,1105,1,124,1001,1034,-1,1039,1008,1036,0,1041,101,0,1035,1040,102,1,1038,1043,1001,1037,0,1042,1106,0,124,1001,1034,1,1039,1008,1036,0,1041,1001,1035,0,1040,102,1,1038,1043,1001,1037,0,1042,1006,1039,217,1006,1040,217,1008,1039,40,1032,1005,1032,217,1008,1040,40,1032,1005,1032,217,1008,1039,9,1032,1006,1032,165,1008,1040,5,1032,1006,1032,165,1101,0,2,1044,1105,1,224,2,1041,1043,1032,1006,1032,179,1102,1,1,1044,1106,0,224,1,1041,1043,1032,1006,1032,217,1,1042,1043,1032,1001,1032,-1,1032,1002,1032,39,1032,1,1032,1039,1032,101,-1,1032,1032,101,252,1032,211,1007,0,40,1044,1106,0,224,1101,0,0,1044,1106,0,224,1006,1044,247,102,1,1039,1034,101,0,1040,1035,101,0,1041,1036,1001,1043,0,1038,1001,1042,0,1037,4,1044,1106,0,0,26,29,83,66,1,36,14,44,33,12,3,15,20,56,9,35,51,55,6,20,13,71,15,23,94,38,45,15,47,30,89,39,11,55,5,9,47,29,41,36,78,12,4,65,48,66,36,94,76,30,63,41,32,1,73,1,35,65,87,46,18,90,11,44,30,73,87,8,38,46,17,78,51,34,19,53,37,26,20,24,46,64,17,6,26,41,10,62,14,88,23,94,13,55,5,45,10,39,83,99,32,34,72,30,58,33,71,47,21,38,97,38,46,41,18,39,37,8,86,55,35,4,92,19,21,53,61,6,55,69,16,85,62,26,63,17,80,33,10,53,91,2,37,94,37,93,7,97,18,55,54,36,17,62,89,12,92,32,69,4,46,47,19,89,25,12,51,91,9,1,71,35,56,39,98,48,7,49,24,95,15,45,2,1,93,82,19,7,11,70,30,64,28,27,58,4,39,30,94,72,33,43,90,98,26,32,70,1,81,25,35,47,17,31,92,15,73,13,27,72,65,30,67,2,22,89,77,30,47,12,58,26,79,22,37,74,41,3,42,30,39,67,24,18,62,98,19,59,95,25,6,67,42,35,85,51,48,7,63,17,67,53,45,13,25,43,1,54,4,65,55,20,73,32,70,1,33,39,93,88,19,35,56,21,13,53,73,31,21,44,73,31,13,69,30,42,26,51,25,90,16,49,9,93,50,28,60,24,18,61,23,11,98,19,45,77,12,61,31,3,66,56,4,77,24,59,87,31,38,65,67,7,9,23,71,9,59,35,55,83,22,12,94,17,67,87,96,63,8,29,32,34,15,55,39,60,41,74,39,81,47,51,25,26,57,28,18,60,84,20,16,66,42,14,25,16,94,2,22,74,85,19,63,32,9,19,11,91,44,34,21,1,56,12,87,8,52,18,56,7,90,5,86,81,24,98,21,9,80,59,68,10,80,53,18,75,50,9,14,43,26,29,57,86,39,41,93,3,69,55,16,84,15,22,84,30,72,19,13,15,19,80,97,79,32,68,77,82,30,19,4,71,45,67,14,95,17,54,80,88,25,13,80,41,37,96,15,28,26,33,73,32,45,79,21,52,23,98,82,21,16,13,64,32,39,93,17,33,95,61,36,12,21,3,84,4,88,22,26,59,80,27,82,2,85,79,29,33,52,17,23,95,8,64,16,56,23,42,43,18,41,11,9,84,42,62,4,67,17,98,76,99,1,16,72,72,10,79,19,76,4,54,9,99,34,33,7,97,85,19,76,93,38,6,90,37,90,2,83,61,19,43,39,2,91,17,60,21,79,2,32,94,38,32,7,64,8,14,7,68,23,28,75,24,73,50,29,63,22,89,4,51,66,2,7,33,82,13,23,84,81,23,55,68,15,27,9,97,27,79,42,86,75,56,13,95,74,5,88,25,44,99,33,14,24,29,21,78,4,15,75,32,92,74,11,56,24,57,10,28,73,8,10,90,77,30,96,8,60,3,71,20,41,9,33,89,38,74,95,4,95,35,13,18,55,10,81,9,60,17,67,7,34,48,48,15,54,79,37,66,43,22,64,28,28,4,91,5,9,92,30,64,37,98,66,15,92,2,3,25,70,25,33,61,56,25,70,58,30,41,97,18,54,10,49,45,3,1,30,57,30,46,8,55,79,39,58,46,35,19,38,80,86,4,36,75,29,62,39,71,2,41,6,66,36,99,21,61,39,72,3,48,29,43,31,59,84,71,12,52,61,82,11,56,23,51,30,60,88,65,35,48,24,58,76,49,93,51,33,72,0,0,21,21,1,10,1,0,0,0,0,0,0 diff --git a/aoc2019/input/day16.in b/aoc2019/input/day16.in new file mode 100644 index 0000000..b8d468b --- /dev/null +++ b/aoc2019/input/day16.in @@ -0,0 +1 @@ +59705379150220188753316412925237003623341873502562165618681895846838956306026981091618902964505317589975353803891340688726319912072762197208600522256226277045196745275925595285843490582257194963750523789260297737947126704668555847149125256177428007606338263660765335434914961324526565730304103857985860308906002394989471031058266433317378346888662323198499387391755140009824186662950694879934582661048464385141787363949242889652092761090657224259182589469166807788651557747631571357207637087168904251987880776566360681108470585488499889044851694035762709053586877815115448849654685763054406911855606283246118699187059424077564037176787976681309870931 \ No newline at end of file diff --git a/aoc2019/input/day17.in b/aoc2019/input/day17.in new file mode 100644 index 0000000..9b6105d --- /dev/null +++ b/aoc2019/input/day17.in @@ -0,0 +1 @@ +1,330,331,332,109,3132,1102,1,1182,16,1101,1467,0,24,101,0,0,570,1006,570,36,101,0,571,0,1001,570,-1,570,1001,24,1,24,1105,1,18,1008,571,0,571,1001,16,1,16,1008,16,1467,570,1006,570,14,21102,58,1,0,1106,0,786,1006,332,62,99,21102,1,333,1,21102,73,1,0,1106,0,579,1101,0,0,572,1101,0,0,573,3,574,101,1,573,573,1007,574,65,570,1005,570,151,107,67,574,570,1005,570,151,1001,574,-64,574,1002,574,-1,574,1001,572,1,572,1007,572,11,570,1006,570,165,101,1182,572,127,1001,574,0,0,3,574,101,1,573,573,1008,574,10,570,1005,570,189,1008,574,44,570,1006,570,158,1105,1,81,21101,0,340,1,1106,0,177,21101,0,477,1,1105,1,177,21101,514,0,1,21102,176,1,0,1106,0,579,99,21102,1,184,0,1106,0,579,4,574,104,10,99,1007,573,22,570,1006,570,165,1002,572,1,1182,21102,1,375,1,21101,0,211,0,1106,0,579,21101,1182,11,1,21102,1,222,0,1106,0,979,21102,388,1,1,21102,233,1,0,1105,1,579,21101,1182,22,1,21101,244,0,0,1106,0,979,21102,1,401,1,21101,255,0,0,1105,1,579,21101,1182,33,1,21102,266,1,0,1105,1,979,21102,1,414,1,21102,1,277,0,1105,1,579,3,575,1008,575,89,570,1008,575,121,575,1,575,570,575,3,574,1008,574,10,570,1006,570,291,104,10,21102,1,1182,1,21101,313,0,0,1105,1,622,1005,575,327,1101,0,1,575,21102,1,327,0,1106,0,786,4,438,99,0,1,1,6,77,97,105,110,58,10,33,10,69,120,112,101,99,116,101,100,32,102,117,110,99,116,105,111,110,32,110,97,109,101,32,98,117,116,32,103,111,116,58,32,0,12,70,117,110,99,116,105,111,110,32,65,58,10,12,70,117,110,99,116,105,111,110,32,66,58,10,12,70,117,110,99,116,105,111,110,32,67,58,10,23,67,111,110,116,105,110,117,111,117,115,32,118,105,100,101,111,32,102,101,101,100,63,10,0,37,10,69,120,112,101,99,116,101,100,32,82,44,32,76,44,32,111,114,32,100,105,115,116,97,110,99,101,32,98,117,116,32,103,111,116,58,32,36,10,69,120,112,101,99,116,101,100,32,99,111,109,109,97,32,111,114,32,110,101,119,108,105,110,101,32,98,117,116,32,103,111,116,58,32,43,10,68,101,102,105,110,105,116,105,111,110,115,32,109,97,121,32,98,101,32,97,116,32,109,111,115,116,32,50,48,32,99,104,97,114,97,99,116,101,114,115,33,10,94,62,118,60,0,1,0,-1,-1,0,1,0,0,0,0,0,0,1,0,10,0,109,4,1202,-3,1,587,20102,1,0,-1,22101,1,-3,-3,21101,0,0,-2,2208,-2,-1,570,1005,570,617,2201,-3,-2,609,4,0,21201,-2,1,-2,1105,1,597,109,-4,2105,1,0,109,5,2102,1,-4,630,20102,1,0,-2,22101,1,-4,-4,21101,0,0,-3,2208,-3,-2,570,1005,570,781,2201,-4,-3,653,20101,0,0,-1,1208,-1,-4,570,1005,570,709,1208,-1,-5,570,1005,570,734,1207,-1,0,570,1005,570,759,1206,-1,774,1001,578,562,684,1,0,576,576,1001,578,566,692,1,0,577,577,21101,702,0,0,1105,1,786,21201,-1,-1,-1,1105,1,676,1001,578,1,578,1008,578,4,570,1006,570,724,1001,578,-4,578,21101,0,731,0,1106,0,786,1106,0,774,1001,578,-1,578,1008,578,-1,570,1006,570,749,1001,578,4,578,21101,0,756,0,1105,1,786,1105,1,774,21202,-1,-11,1,22101,1182,1,1,21102,1,774,0,1106,0,622,21201,-3,1,-3,1106,0,640,109,-5,2106,0,0,109,7,1005,575,802,21002,576,1,-6,20101,0,577,-5,1105,1,814,21101,0,0,-1,21101,0,0,-5,21102,1,0,-6,20208,-6,576,-2,208,-5,577,570,22002,570,-2,-2,21202,-5,45,-3,22201,-6,-3,-3,22101,1467,-3,-3,1201,-3,0,843,1005,0,863,21202,-2,42,-4,22101,46,-4,-4,1206,-2,924,21102,1,1,-1,1105,1,924,1205,-2,873,21101,0,35,-4,1105,1,924,2102,1,-3,878,1008,0,1,570,1006,570,916,1001,374,1,374,2102,1,-3,895,1102,2,1,0,1201,-3,0,902,1001,438,0,438,2202,-6,-5,570,1,570,374,570,1,570,438,438,1001,578,558,921,21001,0,0,-4,1006,575,959,204,-4,22101,1,-6,-6,1208,-6,45,570,1006,570,814,104,10,22101,1,-5,-5,1208,-5,37,570,1006,570,810,104,10,1206,-1,974,99,1206,-1,974,1102,1,1,575,21101,0,973,0,1106,0,786,99,109,-7,2105,1,0,109,6,21101,0,0,-4,21102,0,1,-3,203,-2,22101,1,-3,-3,21208,-2,82,-1,1205,-1,1030,21208,-2,76,-1,1205,-1,1037,21207,-2,48,-1,1205,-1,1124,22107,57,-2,-1,1205,-1,1124,21201,-2,-48,-2,1106,0,1041,21102,1,-4,-2,1105,1,1041,21101,0,-5,-2,21201,-4,1,-4,21207,-4,11,-1,1206,-1,1138,2201,-5,-4,1059,1202,-2,1,0,203,-2,22101,1,-3,-3,21207,-2,48,-1,1205,-1,1107,22107,57,-2,-1,1205,-1,1107,21201,-2,-48,-2,2201,-5,-4,1090,20102,10,0,-1,22201,-2,-1,-2,2201,-5,-4,1103,2101,0,-2,0,1106,0,1060,21208,-2,10,-1,1205,-1,1162,21208,-2,44,-1,1206,-1,1131,1106,0,989,21102,1,439,1,1105,1,1150,21101,0,477,1,1106,0,1150,21102,1,514,1,21102,1,1149,0,1105,1,579,99,21101,1157,0,0,1106,0,579,204,-2,104,10,99,21207,-3,22,-1,1206,-1,1138,1201,-5,0,1176,2102,1,-4,0,109,-6,2106,0,0,8,9,36,1,7,1,36,1,1,13,30,1,7,1,5,1,30,1,7,1,5,1,7,11,12,1,7,1,5,1,7,1,9,1,12,1,7,1,5,1,7,1,1,13,8,1,7,1,5,1,7,1,1,1,7,1,3,1,8,1,7,1,5,1,7,1,1,1,7,1,3,1,8,1,7,1,5,1,7,1,1,1,7,1,3,10,5,9,1,13,3,1,3,1,14,1,1,1,7,1,5,1,1,1,3,1,3,1,3,1,8,9,5,9,1,1,3,1,3,1,3,1,8,1,5,1,7,1,1,1,7,1,3,1,3,1,3,1,8,1,5,1,7,1,1,1,7,1,3,1,3,1,3,1,8,1,5,1,7,1,1,1,7,1,3,1,3,1,3,1,8,1,5,1,7,1,1,1,7,9,3,1,8,1,5,1,7,1,1,1,11,1,7,1,8,1,5,1,7,1,1,11,1,9,8,1,5,1,7,1,11,1,18,13,1,1,11,1,24,1,5,1,1,1,11,1,24,9,11,1,30,1,13,1,30,1,13,1,30,1,13,1,30,1,13,9,22,1,21,1,22,11,11,1,32,1,11,1,32,1,11,1,32,1,11,1,32,1,11,1,32,1,11,1,32,1,11,1,32,1,11,1,32,13,2 diff --git a/aoc2019/input/day18.in b/aoc2019/input/day18.in new file mode 100644 index 0000000..fe32fb3 --- /dev/null +++ b/aoc2019/input/day18.in @@ -0,0 +1,81 @@ +################################################################################# +#...#.................#...#.........#...#....j......................#.......#...# +#.###.###########.#####.#.###.###.#.###.#.###############.#########.#.###.#.#.#.# +#.#...#.....#...#.......#...#...#.#...#.#.#.........#...#...#...#...#.#...#...#.# +#.#.###.###.###.###########.#.###.###.#.#.#####.###.#.#.###.#.###.###.#.#######.# +#...#...#.#...#.....#...#...#.#...#.....#.#.....#.#.#.#.#...#...#.#p..#...#...#.# +#.#####.#.###.###.###.#.#.###.#.#######.#.#.#####.#.#.#.#.###.#.#.###.###.#.#.### +#...#...#.........#r..#...#...#.......#.#.#...#.M.#...#.#...#.#.....#...#.#.#...# +###.#.###########.#.#######.#########.#.#.###.#.#######.###.#######.#####.#.###.# +#...#.#....i..#...#.......#....e#...#.#.#.....#...#.......#.......#.......#...#.# +#.###.#.#####.#.#########.#####.#.#.#.###.#######.#.#######.#####.#.#########.#.# +#...#.#.#...#.#.....#.....#...#.#.#.#...#.#.....#.....#...#.#.....#.#.......#.#.# +###.#.#.#.#.#Y#####.#.#####.###.#.#.###.#.#.###.#######.#.###.###.###.#####.#.#.# +#d#...#.#.#.....#...#...#.....#...#.#...#.#.#...#...#...#...#.#...#...#...#...#.# +#.###.#.#######.###.###.#.###.###.###.#.###.#.###.#.#.#####.#.#####.###.#######.# +#...#.#.......#...#.#...#...#...#.#...#.#...#.....#...#...#...#...#.#.........#.# +#.#.#.#######.###.###.#####.#.###.#.###.#.###########.#.#.###.#.#.#.#####.#####.# +#.#.#.#.....#.#...#...#...#.#.....#.#...#.....#.......#.#.#...#.#...#...#.#..a..# +###.#.#####.#.#.###.###.#.#.#######.#####.###.#####.###.#.#####.#####.#.#.#.##### +#...#.......#.#...#.#...#.#.#.......#...#.#.#.....#...#.#.#...........#...#.....# +#.#########.#.###.#U###.###.#.###.###.#.#.#.#####.#####.#.#.#############.#####.# +#...#.......#q..#...#.#.....#.#...#...#.#.....#.#.#.....#...#.#...#.........#...# +#.#.#.#########.#####.#######.###.#.###.#####.#.#.#.#########.#.#.#.#######.#.#.# +#.#...#.......#.....#..v#...#...#.#...#.#...#g..#.#.#.......#.#.#.#...#...#.#.#.# +#.#####.#.#########.###.#.#.###.#####.#.#.#####.#.#.###.###.#.#.#.###.#.#.#.#.### +#.....#.#.#...#...#...#...#...#.#.....#.#.#...#.#...#...#.#.#.#.#.....#.#.#.#...# +#####.###.#.#.#.#.###.#######.#.#.#####.#.#.#.#.#####.###.#.#.###.#####.#.#.###.# +#.....#...#f#.H.#.......#...#n#...#.....#.#.#.#.......#...#.#...#.#.....#.#.#...# +#.#####.#.#.#########.###Z#.#.#.###.###.#.#.#.#########.###.###.#.#.#####.###.#.# +#...#.G.#.#.....#.....#...#...#...#...#.#...#.....#.........#..h#.#.#.....#...#.# +###.#.###.#####.###.###.#########.###.#.#.#####.#.#.#########.#####.###.###.###.# +#...#...#.#...#...#...#.#.#.....#...#.#.#.....#.#.#...#.......#...#...#.....#...# +#.#####.#.###.###.#####.#.#.###.###.#.#.#.#####.#.###.#.#######.#.#.#.#######.### +#.#...#.#.....#.#...#...#.....#.....#.#.#.#.....#.#...#.#.......#.#.#.#.........# +#.#.#.#.#####.#.###.#.###############.#.###.#####.#.###Q###.#.###.###.#########.# +#.#.#.#...#...#...#...#.......#...#...#.#...#...#.#.#.#...#.#...#...#.........#.# +#.#.#.###L#.###.#.#####.#.###.#.#.#.#####.###.#.###.#.###.#####.###.#.#######.### +#...#...#.#.#...#...#..t#...#...#.#.....#.....#...#.#...#.....#.#.#.#.#.....#..u# +#######.#.#.#.#####.#######.#####.#####.#.#######.#.###.#####.#.#.#.###.###.###.# +#.........#...#.............#...................#...........#...#......y#.......# +#######################################.@.####################################### +#.................#...........#.......................#.......#.....#.......#...# +#.###.#######.#####.#####.###.#.#######.#.#######.#####.#C###.#.#.#.#.#.#####.#.# +#.#...#...#...#.....#.#...#.#.#.#.......#.#.....#.......#.#.#.#.#.#.#.#.......#.# +#.#.###.#.#.###.#####.#.###.#.###.#####.#.#.###.#########.#.#.#.#.###.#########.# +#.#.....#.#...#.....#.#.#......c#.#.....#...#.#...#...#...#...#.#...#...#...#...# +#.#######.#########.#.#.#######.#.#####.#####.###.#.###.#.#####.###.###.#.#.#.### +#.#...#...#....x......#.......#...#...#.#.......#...#...#.#...#.#l....#.#.#.#...# +#.#.###.###.#########.#######.#####.#.###.###.#####.#.#####.#.#.#.###.#.#.#####.# +#.#...#...#.#.......#...#...#...#...#...#.#...#.....#.#.....#.#.#...#.#.#.#...#.# +#.###.###.#.#.#####.###.###.###.#.#####.#.#####.#####.#.#####.#.###.###.#.#.#.#.# +#.#.....#...#...#...#.#...#...#.....#.#.#.#.....#...#.T.....#.#...#.#...#.#.#...# +#.#.###########.#.###.###.#.#######.#.#.#.#.#####.#.#######.#.#X###.#.###.#.###W# +#.#.#.........#.#.#.....#.#.#.....#...#.#...#...#.#...#...#.#...#...#...#.#...#.# +#.#.#.#.###.###.#.#.#.#.#.#.#.###.#####.#.###.###.###.#.#.#####.#.#####.#.###.#.# +#.#..w#...#.#...#.#.#.#.#.#.#.#.#.#.....#.....#...#.#.#.#.....#.#..........s#.#.# +#.#######.###.###.#.#.###.#.#.#.#.#.###.#.#####.###.#.#.#####.#############.#D#.# +#...S...#...#.#.#.#.#.......#.#.....#.#.#.#.....#.....#.....#...#.....#.....#.#.# +#######.###.#.#.#.###########.#######.#.#.#.#######.###.###.###.#.###.#######.#.# +#...#.......#.#.#.#.........#...#.....#.#.#.......#.#.....#.#.....#...#.....#.#.# +#.#.#######.#.#.#.#.#######.###.#.#####.#########.#.#######.#######.###.###.#.### +#.#...#...#.#.#.#...#.....#.#...#.......#.....#...#...#.....#.K.#.......#...#...# +#.###.#.#.###.#.#########.#.#.###.#######.###.#.#####.#.###.###.#########.###.#.# +#.#.#.#.#.....#.E...#...#...#.#.#.......#z#.F...#...#...#.#...#...#.....#.#...#.# +#.#.#.#.#######.###.#.#.#####.#.#######.#.###.###.#.#####.#.#####.#.#.###.#.###.# +#...#...#.........#.#.#.......#.....#...#...#.#...#...#...I.#.....#.#.....#...#.# +###.#######.#####.#.#.#.#######.###.#.###.#.###.#####.#.#####.#####.###########.# +#.#.......#.#.....#.#.#.#.........#.#.#.#.#.#...#.....#.#...#.#...#...#.......#.# +#.#######.###.#####.###.#.#########.#.#.#.#.#.###.#####.#.#.#.###.###.###.###.#.# +#...#...#...#.#...#...#.#.#.....#...#.#.#.#...#.#.#...#...#.#k#.....#...#.#.....# +#.###.#A###.#.#.#####.#.#.#.#.#.#.###.#.#.#####.#.#.#.#.#####.#.#######.#.####### +#.#...#...#...#.....#...#.#.#.#.#.#...#.#.#.....#.#.#...#.B...#...#.....#.......# +#.#.#####.#######.#######.###.###.#.###.#.#.#####.#.#####.#######.#.#########.#.# +#.#.#...#.........#.....#...#...#.#.#...#...#.....#.#.....#.....R.#.........#.#.# +#.#.#.#######.#####.###.###.###.#.#.###J###.#.#######.#####.###.###########.###.# +#.#.#.#.......#.....#.#.#...#...#...#...#.#.#.V.....#b..#...#...#.........#.....# +#.#.#.#.#######.#####.#.#.###.#.#####.#.#.#.#######.###.#.#.#####.###.#.#######.# +#.#...#.......#.#.....#.#.#...#.#...#.#.#.#.....#..o#.O.#.#.....#.#...#.#...#...# +#.###.#######.#.#####.#.#.###.#.#.#.#.#.#.#####.#.###.###.#####.#.#.#####.#.#.### +#........m..#.........#.......#...#...#.#.N.....#.....#.......#...#.....P.#.....# +################################################################################# diff --git a/aoc2019/input/day19.in b/aoc2019/input/day19.in new file mode 100644 index 0000000..1d8e0c8 --- /dev/null +++ b/aoc2019/input/day19.in @@ -0,0 +1 @@ +109,424,203,1,21102,1,11,0,1106,0,282,21101,0,18,0,1106,0,259,1202,1,1,221,203,1,21101,0,31,0,1105,1,282,21102,38,1,0,1105,1,259,20102,1,23,2,21201,1,0,3,21102,1,1,1,21101,0,57,0,1105,1,303,2101,0,1,222,20102,1,221,3,21002,221,1,2,21101,0,259,1,21101,0,80,0,1106,0,225,21102,1,152,2,21101,91,0,0,1106,0,303,1201,1,0,223,21001,222,0,4,21101,0,259,3,21102,225,1,2,21101,0,225,1,21102,1,118,0,1105,1,225,20101,0,222,3,21102,61,1,2,21101,133,0,0,1106,0,303,21202,1,-1,1,22001,223,1,1,21102,148,1,0,1105,1,259,2101,0,1,223,21001,221,0,4,21001,222,0,3,21101,0,14,2,1001,132,-2,224,1002,224,2,224,1001,224,3,224,1002,132,-1,132,1,224,132,224,21001,224,1,1,21101,0,195,0,105,1,109,20207,1,223,2,20101,0,23,1,21102,-1,1,3,21102,214,1,0,1105,1,303,22101,1,1,1,204,1,99,0,0,0,0,109,5,2101,0,-4,249,21202,-3,1,1,21202,-2,1,2,21201,-1,0,3,21102,1,250,0,1106,0,225,22101,0,1,-4,109,-5,2106,0,0,109,3,22107,0,-2,-1,21202,-1,2,-1,21201,-1,-1,-1,22202,-1,-2,-2,109,-3,2105,1,0,109,3,21207,-2,0,-1,1206,-1,294,104,0,99,22102,1,-2,-2,109,-3,2105,1,0,109,5,22207,-3,-4,-1,1206,-1,346,22201,-4,-3,-4,21202,-3,-1,-1,22201,-4,-1,2,21202,2,-1,-1,22201,-4,-1,1,21202,-2,1,3,21101,343,0,0,1106,0,303,1105,1,415,22207,-2,-3,-1,1206,-1,387,22201,-3,-2,-3,21202,-2,-1,-1,22201,-3,-1,3,21202,3,-1,-1,22201,-3,-1,2,22101,0,-4,1,21101,0,384,0,1106,0,303,1105,1,415,21202,-4,-1,-4,22201,-4,-3,-4,22202,-3,-2,-2,22202,-2,-4,-4,22202,-3,-2,-3,21202,-4,-1,-2,22201,-3,-2,1,21201,1,0,-4,109,-5,2106,0,0 diff --git a/aoc2019/input/day20.in b/aoc2019/input/day20.in new file mode 100644 index 0000000..0047b8a --- /dev/null +++ b/aoc2019/input/day20.in @@ -0,0 +1,119 @@ + C T N Z D C X P + Y L Z Z M V Z P + ###################################.###########.#####.#.#######.###.#######.#.####################################### + #.#.#.#.#.#...#.......#...#.........#...#...........#.#.....#.....#.......#...............#.............#...#.......# + #.#.#.#.#.###.#.###.###.###.###.###.#.#.###.#.###.###.#.#.#####.#.#.###.#########.###.#####.#.###.###.#####.#####.### + #.....#...#.....#.#.........#...#.....#...#.#.#...#.#...#.#.....#.#.#.#.....#.......#...#...#...#...#.#.....#...#.#.# + #####.###.#######.###.#.#.###.###.#.###.#########.#.#.###.#.#########.###.#####.#####.#####.#########.###.###.###.#.# + #...........#.......#.#.#.#...#...#.#.......#.......#.#...#.......#.#.........#.#.#.....#.#.......#.#.#.......#.....# + #####.#.#.#######.#.###.#####.#####.#####.#######.###.###.###.#####.#.###.#####.#.###.###.#.#.#####.#####.#.###.#.### + #.....#.#.....#.#.#.#.#...#...#.....#.....#.#.#.....#...#...#...#.......#...#.#...#.#.......#...#.#...#...#.#...#...# + #.#.#.#.#####.#.###.#.###########.#######.#.#.###.#.#####.#####.###.#.###.#.#.#.###.#.###.#######.#.#####.#####.##### + #.#.#.#.#.#.#.........#...#...#...#.#.#...#...#.#.#...#...#...#...#.#...#.#.#.#...#.....#.....#.#.....#...#.#...#...# + #.#.#.#.#.#.#.###.#.#.###.###.#####.#.#.###.#.###.#.###.#.###.###.#.#########.#.#######.#.#.###.#.#.#####.#.#.#.###.# + #.#.#.#.#.....#.#.#.#.#.....#.......#.#.#...#.....#...#.#.#.....#.#.....#...#.........#.#.#...#...#.#...#.....#.#...# + #######.#######.#####.###.###.#####.#.#.###.###.#.#######.###.#.#.#.#####.###.#######.###.#####.#.###.###.#.#.###.#.# + #.#...#.#.#.#...#...#...#.#.#.#...#.#...#.....#.#.#...#...#.#.#...#...#...#.......#.....#.......#...#...#.#.#.#.#.#.# + #.###.###.#.#.#.#.###.###.#.#####.#.#.#.###.#######.#####.#.#.#.#.#.###.###.#############.#.###.#######.#.#####.###.# + #.#.....#.....#.................#.....#.#.#...#.....#.#.#.#...#.#.#.....#.#.#...#.....#...#.#.#.#...#.......#...#...# + #.###.#.###.#####.#.#.#.#####.###.#.#.###.#.#.###.#.#.#.#.#.#.#.#####.###.#.#.###.###########.#####.###.#######.###.# + #...#.#.#...#.....#.#.#.#...#.#...#.#.#.....#...#.#.....#.#.#.#...#...#...#...#.#.#.#.....#...#.....#.....#.#.....#.# + ###.#.###.#.###.#.#########.#.###.#.###.###.#.#####.###.#.#.#######.#####.#.###.#.#.#.#######.#####.###.###.###.###.# + #...#.#.#.#.#...#.#...#.........#.#.#...#.#.#.#.......#.#.#.....#...#.....#...........#.#.#.#.#.#.....#...#.#.....#.# + ###.#.#.#######.#####.#######.#####.#####.#.#########.#.#.###.#####.#.###.#.#.#.###.###.#.#.#.#.#.#.###.###.#.#####.# + #.........#...#...#.#.#.............#...#.......#.....#...#.......#.#.#...#.#.#...#.....#...#.#...#...#.#...#.#.#.#.# + #####.#.###.#######.#.#####.#######.#.###.#.#.###.#.#######.#######.#.#.###.#.#.#########.###.###.#####.#.###.#.#.#.# + #.....#...#.....#.#...#.....#.#.#.....#...#.#.#.#.#.......#...#...#.#.#.#.#.#.#...#...#...#.........#...#.#...#.#.#.# + #####.#.#####.###.#.#########.#.###.#####.#.###.#########.#.###.###.#.#.#.#.#########.###.###.#########.#.###.#.#.#.# + #...#.#.#.#.......#.#.#.....#.#.........#.#...#...#.......#.......#.#.#...#.#.#...#...#...........#...#.#.....#.....# + ###.###.#.###.###.#.#.#.###.#.###.#.#######.###.###.#######.###.###.#.###.#.#.###.#.#.#######.#####.###.#.#.###.#.### + #.......#.#.#...#.#...#.#...#.#...#.#.....#.....#.#.....#.#...#.#.#.#.#.#.#...#...#.#.....#.....#.#.#...#.#...#.#...# + #####.#.#.#.#####.#.#######.#.#####.#.#####.#.###.###.#.#.#.#####.#.#.#.#.#.###.#####.#######.###.#.#.#####.###.##### + #...#.#.......#.......#...................#.#...#.....#.#.........#...#...#...........#.#.......#.#...#.#.....#...#.# + ###.###.#######.###.#################.#####.###########.#######.#######.#####.#.#######.#.#####.#.###.#.###.###.#.#.# + #.#...#.#.#...#.#...#.#.....#.# G U U G Y P J #...#.....#.#.#.#...#.#.#.#.#.# + #.###.#.#.#.#.#####.#.###.###.# Y M C C O Y V ###.#####.#.#.#.###.#.#.#.###.# +UM....#...#.#.#.#...#.#.#.......# #.#.#.#...#.........#.........# + #.#####.#.#.#####.#.#.#.#.#.### #.###.#.#.#.#.#.###.#.###.#.### + #.............#...#.#.#.#.#.#..LM #.#...#.#.#.#.#...#.....#.#.#.# + #.###.#####.#####.#.#.#.#.###.# #.#.###.#.#.###.###.#.###.###.# + #...#.#...#.............#.....# TL..#.....#.....#.#...#.#...#.#.# + #########.###########.###.##### #.#####.#.###########.###.#.#.# + #...#...............#.#.#.#...# #.......#...#.......#.#........PY + #.###.#.###.#.###.#####.###.### #############.#.#.############# +YO......#.#...#...#.#.......#...# WH..#.#.#.#.#.#.#.#...#.#.......# + #.#.#.#.#.#.#####.#.#.#####.### #.#.#.#.#.#.#####.#.#.###.#.### + #.#.#.#.#.#.#.......#.#.#.#.#..AM #.#.#...#.#.#.....#.#.#...#....KK + #######.###.#####.###.#.#.#.#.# #.#.#.###.#.#####.#.#.#.###.### + #...#...#...#.#.....#.........# #.......#.....#.#.#.....#...#.# + #.###########.#############.### #####.#.###.#.#.#.###.###.#.#.# + #...#.#...#.#...#.........#.#..XI #...#.#.....#.....#.....#.#.#.# + #.###.#.###.###.#.###.#######.# ###.###.#####################.# + #.#...#.#...#.#.#.#.....#.....# #...#.#.#...#.#.........#.....# + #.#.###.#.#.#.#.#.#.#####.##### ###.#.###.###.#.#.#.###.#.###.# +AW..........#.......#...........# #.#.....#...#...#.#.#.....#...# + ############################### #.#.###.#.#.#.#.###.###.###.### + #.......#.....................# CV..#...#...#...#...#...#.#.....# + ###.###.#.###.###.#.#.###.###.# #.###.###.#.#.###.###########.# + #...#...#...#.#...#.#.#...#.#..HB #.....#...#.#.#.#.#.#.....#.#..CQ + ###.#.#####.#.#####.#####.#.#.# #.###.###.#####.###.###.###.### +GL..#.#.....#.#.#...#.#...#...#.# #...#...#.#.#...#...#.#.......# + #.#.#.#.#.#.#####.###.######### ###########.###.#.#.#.#.#####.# + #...#.#.#.....#.#.......#.#...# #...#.#.........#.#...#.....#.# + ###############.#.#######.#.### ###.#.#####.###.#####.#####.#.# +PN....#.................#.....#.# #.#.....#.#...#.#...........#..JV + #.#.#.###.#.#########.###.#.#.# #.###.###.#.#.#####.#.#.###.### + #.#.#...#.#.#.........#...#.#..NZ CY............#.......#.#.#.#.#.# + ###.###.###.#.###.#######.#.#.# #######.#######.#########.###.# + #.....#...#.#.#.....#...#.#.#.# DM......#.#...#...#.#...#...#....AM + #.#.###.###########.#.#.#.#.#.# ###.#####.#.#####.#.###.#.#.#.# + #.#...........#.......#...#...# #.#.#...#.#...#.#.......#.#.#.# + ###############.###########.#.# #.#.###.#.#.###.###.#.###.#.### + #.#.....#.....#.#.......#.#.#.# #...#.....#...#...#.#.#...#...# + #.#.#.###.#######.###.###.###.# #.#.###.###.#.###.#.###.#####.# + #...#.#.#...#.#.#...#.......#.# #.#.......#.#.........#.......# + #.###.#.#.###.#.###.#####.##### #######.#.#.###.#.#####.#.###.# +YF..#.#.........#...#...#...#....PN XZ......#.#.#.#.#.#.#.....#.#.#.# + #.#.#######.###.#.###.###.#.### #####.#####.#.#.###########.### + #.#.#.#.#.......#.......#.....# #.........#.#.#.#.#...........# + ###.#.#.###.#######.#.######### #.###########.###.#.###.####### + #.......#...#.#...#.#...#.#....KY #.......#.#.....#...#.#.......# + #####.#.#####.#.#########.###.# #.#.###.#.###.###.###.#.####### +YA..#...#.....#.#...#...#.#.....# #.#...#.............#..........KY + #.###.###.###.#.#.#.#.#.#.##### #.#########.#.#.#####.#.#.#.#.# + #.......#.......#...#.........# #...#.......#.#.#.#...#.#.#.#.# + #.#######.###.###.#.#.#.#.###.# A K C G Y Y P #.#######.#.###.#.#######.##### + #.#.......#...#...#.#.#.#...#.# W K Q L A F P #...#.....#...#...#.#.#.......# + #.###.#####.###.#.#.#.#.#.###.#######.#######.###.#######.#######.#####.#####.#################.#.###.###.#.###.#.### + #.#...#...#.#...#.#.#.#.#...#.#.......#.........#.#.#.#.....#.#.#.....#.#.......#.....#...#.#...#...#.......#...#.#.# + #####.###.#######.#####.#.#######.#.#####.#####.#.#.#.#.#####.#.###.###.###.###.#.#.###.###.###.###.#.###.#####.###.# + #.........#...........#.#.......#.#.....#...#.#.#...#.#...........#.#.....#.#.....#.........#.....#.#.#.....#.#.#...# + #####.#######.#####.###.#.###.#####.#.#####.#.#####.#.###.#.#######.#.#.#####.###.#.###.###.#########.###.###.#.###.# + #.......#.....#...#...#.#...#.#...#.#.....#.....#.#.....#.#...#.....#.#.#.#.#.#.#.#...#.#...#...#.......#.....#.#.#.# + #.###.###.#.#.###.#.#####.#.###.#####.#.###.#.#.#.#.#.#####.#####.###.###.#.###.###.#.#####.###.#.###.###.###.#.#.#.# + #...#...#.#.#.#.....#.#...#.#.#...#...#...#.#.#.#...#...#.#.....#...#.#.#...#.......#...#.....#...#...#...#...#.....# + #.#########.#####.#.#.#.#.###.#.#######.#####.#######.###.#.#.###.###.#.###.#######.#.###.#.#.###.###.#####.#######.# + #.....#.......#...#...#.#.#...#...........#.......#.....#...#...#...#.......#.#...#.#.#...#.#.#.#.#.#...#...#.......# + ###.#####.#.###.#.#####.#.###.###.#.#.#.#.###.#.#####.#####.#####.#####.###.#.###.#.#.###.#.###.#.#.#.#.###.###.###.# + #...#.#...#...#.#...#...#.#.#.....#.#.#.#.#...#.#.....#...#.#.......#...#.#...#.#.#.#.#.#.#.....#.#...#.#.#...#...#.# + #.###.###.#.#####.#.#######.#.###.#####.#####.#.#####.###.#.###.###.###.#.#.###.#.#.###.###.#######.#.###.#########.# + #.#.......#...#.#.#.#...#...#.#.#.#.......#...#.#.#.....#.....#...#...#.#.......#...#.#...#.....#.#.#...........#.#.# + #.#.###.#.#####.#.#.###.###.###.#.#.#.#.###.#####.###.###.#.#######.#.#####.#####.#.#.#.#########.###.###.#.#####.### + #.#.#...#.#...#.#.#...#.......#.#.#.#.#...#.....#...#.#.#.#.#.#.#...#...#.....#.#.#.......#.#...#.......#.#.........# + #####.#######.#.#######.###.###.#######.###.#.#####.#.#.###.#.#.###.#.#.###.###.###.#######.#.#####.###.#####.###.#.# + #.......#.........#...#.#.....#...#.#.....#.#.#.......#.#...#.......#.#.#...#...#...............#...#...#.....#...#.# + #####.#####.#.#.#.###.#####.#.#.###.###.#####.#.#######.#.#.#.###.#######.#.###.###.###.#######.#########.###.###.#.# + #.#...#.....#.#.#...#.#.#...#.............#...#.#.......#.#.#...#.#.....#.#.#.....#...#.....#.........#.....#...#.#.# + #.###.###.#########.#.#.#####.###.#.#.###.###.#.#.###.#.#.#####.###.#######.#.###.#.###.#.#.###.#####.###.#.#####.#.# + #.......#.#.................#.#.#.#.#.#...#...#.#.#.#.#.#...#.#.....#.#.....#.#.#.#...#.#.#...#...#...#...#.....#.#.# + ###.#.###.###########.###.#####.#.#########.###.#.#.#.###.###.#####.#.#.###.#.#.#.#.#######.#.#############.#.####### + #.#.#...#.#.#.#...#.....#.#.............#.....#...#.#.#.....#.....#...#.#.#.#.#.#.......#.#.#.#.#.....#...#.#.......# + #.#########.#.#.#########.#.#####.#######.#.#.#######.#####.#.###.#.###.#.#.#.#.#.###.###.#####.###.###.#####.#.#.### + #.#.......#.....#.#.............#.....#...#.#.#.#...#.#.#...#...#...#...#.#.#.#.#...#.....#.#.............#.#.#.#...# + #.#######.#####.#.###.#####.#####.###########.#.#.###.#.###.###.#########.#.#.###.#.#.#####.#.#.#.###.#.###.###.#.#.# + #.#.......#.#.........#.#...#...#.#.#.#.....#.#.......#.....#.#...#.#.......#...#.#.#.........#.#...#.#.......#.#.#.# + #.#####.###.###.#.#.###.#.#####.#.#.#.###.###.#.#.###.#.#.#.#.#.###.###.###.#.#####.#.#.#.#.#.#####.#############.### + #...............#.#.#.....#.........#.........#.#.#...#.#.#.#.........#...#.#.....#.#.#.#.#.#.#.................#...# + ###################################.#####.#####.###########.###.###.#####.###.####################################### + G H W U A X L G + Y B H C A I M C diff --git a/aoc2019/input/day21.in b/aoc2019/input/day21.in new file mode 100644 index 0000000..48e194e --- /dev/null +++ b/aoc2019/input/day21.in @@ -0,0 +1 @@ +109,2050,21102,966,1,1,21101,13,0,0,1106,0,1378,21102,20,1,0,1106,0,1337,21102,1,27,0,1105,1,1279,1208,1,65,748,1005,748,73,1208,1,79,748,1005,748,110,1208,1,78,748,1005,748,132,1208,1,87,748,1005,748,169,1208,1,82,748,1005,748,239,21101,0,1041,1,21101,0,73,0,1106,0,1421,21102,78,1,1,21102,1041,1,2,21101,0,88,0,1106,0,1301,21102,68,1,1,21101,0,1041,2,21101,0,103,0,1106,0,1301,1102,1,1,750,1106,0,298,21101,0,82,1,21101,1041,0,2,21101,125,0,0,1105,1,1301,1101,0,2,750,1106,0,298,21101,0,79,1,21101,0,1041,2,21102,1,147,0,1106,0,1301,21102,84,1,1,21102,1,1041,2,21101,162,0,0,1105,1,1301,1101,0,3,750,1105,1,298,21102,65,1,1,21102,1,1041,2,21101,0,184,0,1105,1,1301,21102,1,76,1,21101,0,1041,2,21102,199,1,0,1106,0,1301,21101,0,75,1,21102,1,1041,2,21102,1,214,0,1106,0,1301,21102,1,221,0,1106,0,1337,21101,10,0,1,21101,0,1041,2,21101,236,0,0,1105,1,1301,1105,1,553,21102,1,85,1,21102,1,1041,2,21101,0,254,0,1106,0,1301,21102,1,78,1,21102,1041,1,2,21101,269,0,0,1105,1,1301,21102,1,276,0,1105,1,1337,21101,0,10,1,21102,1041,1,2,21101,291,0,0,1105,1,1301,1102,1,1,755,1106,0,553,21101,32,0,1,21101,1041,0,2,21102,1,313,0,1105,1,1301,21102,320,1,0,1106,0,1337,21101,0,327,0,1105,1,1279,2101,0,1,749,21101,0,65,2,21102,73,1,3,21102,346,1,0,1105,1,1889,1206,1,367,1007,749,69,748,1005,748,360,1102,1,1,756,1001,749,-64,751,1106,0,406,1008,749,74,748,1006,748,381,1102,1,-1,751,1106,0,406,1008,749,84,748,1006,748,395,1101,0,-2,751,1106,0,406,21101,0,1100,1,21101,0,406,0,1105,1,1421,21102,1,32,1,21102,1100,1,2,21101,0,421,0,1106,0,1301,21102,1,428,0,1105,1,1337,21102,435,1,0,1105,1,1279,2102,1,1,749,1008,749,74,748,1006,748,453,1102,-1,1,752,1105,1,478,1008,749,84,748,1006,748,467,1101,-2,0,752,1105,1,478,21101,1168,0,1,21101,478,0,0,1105,1,1421,21101,0,485,0,1105,1,1337,21101,10,0,1,21101,0,1168,2,21102,500,1,0,1106,0,1301,1007,920,15,748,1005,748,518,21101,1209,0,1,21101,518,0,0,1105,1,1421,1002,920,3,529,1001,529,921,529,1002,750,1,0,1001,529,1,537,1001,751,0,0,1001,537,1,545,102,1,752,0,1001,920,1,920,1106,0,13,1005,755,577,1006,756,570,21101,0,1100,1,21101,0,570,0,1105,1,1421,21102,1,987,1,1106,0,581,21101,0,1001,1,21102,588,1,0,1106,0,1378,1101,758,0,593,1002,0,1,753,1006,753,654,21002,753,1,1,21102,610,1,0,1105,1,667,21102,1,0,1,21101,621,0,0,1106,0,1463,1205,1,647,21102,1015,1,1,21102,1,635,0,1106,0,1378,21102,1,1,1,21102,646,1,0,1105,1,1463,99,1001,593,1,593,1105,1,592,1006,755,664,1101,0,0,755,1105,1,647,4,754,99,109,2,1101,0,726,757,22102,1,-1,1,21101,0,9,2,21102,1,697,3,21102,692,1,0,1105,1,1913,109,-2,2106,0,0,109,2,101,0,757,706,2101,0,-1,0,1001,757,1,757,109,-2,2106,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,255,63,191,95,223,159,127,0,205,43,234,238,143,157,119,124,170,200,171,249,217,158,189,39,155,167,98,182,247,197,60,204,123,62,71,178,241,183,252,221,38,76,185,199,175,203,218,141,198,246,163,172,253,137,86,99,125,233,59,231,248,166,153,55,78,201,222,244,139,220,77,168,113,121,242,254,169,138,120,56,108,245,57,213,219,122,251,156,239,173,152,162,188,58,142,34,111,107,118,184,79,93,230,102,226,53,232,35,214,228,177,136,115,140,47,190,206,154,54,250,216,196,61,51,103,237,179,42,46,69,116,49,106,212,187,114,174,229,85,207,202,236,50,100,181,215,243,87,227,68,94,84,235,70,109,92,117,110,126,101,186,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,73,110,112,117,116,32,105,110,115,116,114,117,99,116,105,111,110,115,58,10,13,10,87,97,108,107,105,110,103,46,46,46,10,10,13,10,82,117,110,110,105,110,103,46,46,46,10,10,25,10,68,105,100,110,39,116,32,109,97,107,101,32,105,116,32,97,99,114,111,115,115,58,10,10,58,73,110,118,97,108,105,100,32,111,112,101,114,97,116,105,111,110,59,32,101,120,112,101,99,116,101,100,32,115,111,109,101,116,104,105,110,103,32,108,105,107,101,32,65,78,68,44,32,79,82,44,32,111,114,32,78,79,84,67,73,110,118,97,108,105,100,32,102,105,114,115,116,32,97,114,103,117,109,101,110,116,59,32,101,120,112,101,99,116,101,100,32,115,111,109,101,116,104,105,110,103,32,108,105,107,101,32,65,44,32,66,44,32,67,44,32,68,44,32,74,44,32,111,114,32,84,40,73,110,118,97,108,105,100,32,115,101,99,111,110,100,32,97,114,103,117,109,101,110,116,59,32,101,120,112,101,99,116,101,100,32,74,32,111,114,32,84,52,79,117,116,32,111,102,32,109,101,109,111,114,121,59,32,97,116,32,109,111,115,116,32,49,53,32,105,110,115,116,114,117,99,116,105,111,110,115,32,99,97,110,32,98,101,32,115,116,111,114,101,100,0,109,1,1005,1262,1270,3,1262,20102,1,1262,0,109,-1,2105,1,0,109,1,21101,1288,0,0,1105,1,1263,21002,1262,1,0,1102,1,0,1262,109,-1,2106,0,0,109,5,21101,0,1310,0,1105,1,1279,21201,1,0,-2,22208,-2,-4,-1,1205,-1,1332,21202,-3,1,1,21102,1,1332,0,1106,0,1421,109,-5,2105,1,0,109,2,21102,1,1346,0,1106,0,1263,21208,1,32,-1,1205,-1,1363,21208,1,9,-1,1205,-1,1363,1105,1,1373,21101,0,1370,0,1106,0,1279,1106,0,1339,109,-2,2105,1,0,109,5,1201,-4,0,1386,20102,1,0,-2,22101,1,-4,-4,21102,0,1,-3,22208,-3,-2,-1,1205,-1,1416,2201,-4,-3,1408,4,0,21201,-3,1,-3,1106,0,1396,109,-5,2105,1,0,109,2,104,10,21201,-1,0,1,21101,1436,0,0,1106,0,1378,104,10,99,109,-2,2106,0,0,109,3,20002,593,753,-1,22202,-1,-2,-1,201,-1,754,754,109,-3,2106,0,0,109,10,21102,5,1,-5,21101,1,0,-4,21101,0,0,-3,1206,-9,1555,21101,0,3,-6,21101,0,5,-7,22208,-7,-5,-8,1206,-8,1507,22208,-6,-4,-8,1206,-8,1507,104,64,1105,1,1529,1205,-6,1527,1201,-7,716,1515,21002,0,-11,-8,21201,-8,46,-8,204,-8,1106,0,1529,104,46,21201,-7,1,-7,21207,-7,22,-8,1205,-8,1488,104,10,21201,-6,-1,-6,21207,-6,0,-8,1206,-8,1484,104,10,21207,-4,1,-8,1206,-8,1569,21101,0,0,-9,1105,1,1689,21208,-5,21,-8,1206,-8,1583,21101,0,1,-9,1105,1,1689,1201,-5,716,1589,20101,0,0,-2,21208,-4,1,-1,22202,-2,-1,-1,1205,-2,1613,22101,0,-5,1,21102,1613,1,0,1106,0,1444,1206,-1,1634,22102,1,-5,1,21101,0,1627,0,1106,0,1694,1206,1,1634,21102,1,2,-3,22107,1,-4,-8,22201,-1,-8,-8,1206,-8,1649,21201,-5,1,-5,1206,-3,1663,21201,-3,-1,-3,21201,-4,1,-4,1106,0,1667,21201,-4,-1,-4,21208,-4,0,-1,1201,-5,716,1676,22002,0,-1,-1,1206,-1,1686,21101,1,0,-4,1105,1,1477,109,-10,2106,0,0,109,11,21102,1,0,-6,21102,1,0,-8,21101,0,0,-7,20208,-6,920,-9,1205,-9,1880,21202,-6,3,-9,1201,-9,921,1724,21002,0,1,-5,1001,1724,1,1732,21002,0,1,-4,22101,0,-4,1,21101,0,1,2,21101,9,0,3,21101,0,1754,0,1106,0,1889,1206,1,1772,2201,-10,-4,1766,1001,1766,716,1766,21001,0,0,-3,1105,1,1790,21208,-4,-1,-9,1206,-9,1786,21202,-8,1,-3,1105,1,1790,21202,-7,1,-3,1001,1732,1,1796,20101,0,0,-2,21208,-2,-1,-9,1206,-9,1812,22102,1,-8,-1,1106,0,1816,22101,0,-7,-1,21208,-5,1,-9,1205,-9,1837,21208,-5,2,-9,1205,-9,1844,21208,-3,0,-1,1106,0,1855,22202,-3,-1,-1,1106,0,1855,22201,-3,-1,-1,22107,0,-1,-1,1105,1,1855,21208,-2,-1,-9,1206,-9,1869,22102,1,-1,-8,1105,1,1873,22102,1,-1,-7,21201,-6,1,-6,1106,0,1708,22101,0,-8,-10,109,-11,2105,1,0,109,7,22207,-6,-5,-3,22207,-4,-6,-2,22201,-3,-2,-1,21208,-1,0,-6,109,-7,2106,0,0,0,109,5,2101,0,-2,1912,21207,-4,0,-1,1206,-1,1930,21102,0,1,-4,22101,0,-4,1,21201,-3,0,2,21102,1,1,3,21101,0,1949,0,1105,1,1954,109,-5,2105,1,0,109,6,21207,-4,1,-1,1206,-1,1977,22207,-5,-3,-1,1206,-1,1977,22101,0,-5,-5,1106,0,2045,22101,0,-5,1,21201,-4,-1,2,21202,-3,2,3,21102,1,1996,0,1106,0,1954,22102,1,1,-5,21101,0,1,-2,22207,-5,-3,-1,1206,-1,2015,21102,0,1,-2,22202,-3,-2,-3,22107,0,-4,-1,1206,-1,2037,22101,0,-2,1,21102,2037,1,0,105,1,1912,21202,-3,-1,-3,22201,-5,-3,-5,109,-6,2105,1,0 diff --git a/aoc2019/input/day22.in b/aoc2019/input/day22.in new file mode 100644 index 0000000..f7a54bc --- /dev/null +++ b/aoc2019/input/day22.in @@ -0,0 +1,100 @@ +deal with increment 30 +cut 6056 +deal into new stack +deal with increment 13 +cut 495 +deal with increment 58 +deal into new stack +deal with increment 21 +cut 8823 +deal with increment 59 +cut -9853 +deal with increment 65 +deal into new stack +cut -6597 +deal with increment 59 +cut 9239 +deal with increment 4 +deal into new stack +deal with increment 4 +cut 8557 +deal with increment 8 +cut 115 +deal with increment 22 +cut 2088 +deal with increment 65 +deal into new stack +cut 8009 +deal into new stack +cut -7132 +deal with increment 59 +cut 9091 +deal into new stack +deal with increment 46 +cut -5059 +deal into new stack +deal with increment 30 +cut -1320 +deal into new stack +deal with increment 60 +deal into new stack +cut -7889 +deal with increment 60 +deal into new stack +cut -5595 +deal with increment 63 +cut -2711 +deal with increment 34 +cut 6140 +deal into new stack +cut 7103 +deal with increment 15 +cut -8216 +deal with increment 61 +cut -8159 +deal with increment 19 +cut 7942 +deal with increment 10 +cut -1116 +deal with increment 16 +cut -2714 +deal into new stack +deal with increment 70 +cut -7959 +deal with increment 40 +cut 6906 +deal into new stack +deal with increment 65 +cut 8120 +deal with increment 70 +cut -7770 +deal with increment 12 +cut -6563 +deal with increment 62 +cut 9205 +deal with increment 17 +cut 1949 +deal with increment 72 +cut -5249 +deal with increment 6 +cut 948 +deal into new stack +cut 1155 +deal into new stack +deal with increment 26 +cut 5856 +deal with increment 18 +cut -7873 +deal with increment 4 +cut -7413 +deal with increment 18 +cut -7559 +deal with increment 21 +cut -2338 +deal with increment 16 +deal into new stack +cut 9644 +deal with increment 16 +cut -7319 +deal with increment 34 +cut -7603 diff --git a/aoc2019/input/day23.in b/aoc2019/input/day23.in new file mode 100644 index 0000000..67fd867 --- /dev/null +++ b/aoc2019/input/day23.in @@ -0,0 +1 @@ +3,62,1001,62,11,10,109,2267,105,1,0,1590,1977,876,1120,1188,2230,641,1155,1559,936,1847,2189,2117,1029,674,1917,1363,610,1695,1880,2049,1814,1493,1258,705,810,967,905,845,1662,2014,1394,1089,1631,2150,1427,1332,1524,1291,2080,1460,1730,1948,571,1221,742,1060,777,1761,998,0,0,0,0,0,0,0,0,0,0,0,0,3,64,1008,64,-1,62,1006,62,88,1006,61,170,1106,0,73,3,65,21001,64,0,1,21001,66,0,2,21101,0,105,0,1105,1,436,1201,1,-1,64,1007,64,0,62,1005,62,73,7,64,67,62,1006,62,73,1002,64,2,133,1,133,68,133,102,1,0,62,1001,133,1,140,8,0,65,63,2,63,62,62,1005,62,73,1002,64,2,161,1,161,68,161,1102,1,1,0,1001,161,1,169,102,1,65,0,1102,1,1,61,1102,1,0,63,7,63,67,62,1006,62,203,1002,63,2,194,1,68,194,194,1006,0,73,1001,63,1,63,1105,1,178,21102,1,210,0,106,0,69,2102,1,1,70,1101,0,0,63,7,63,71,62,1006,62,250,1002,63,2,234,1,72,234,234,4,0,101,1,234,240,4,0,4,70,1001,63,1,63,1105,1,218,1105,1,73,109,4,21102,0,1,-3,21102,0,1,-2,20207,-2,67,-1,1206,-1,293,1202,-2,2,283,101,1,283,283,1,68,283,283,22001,0,-3,-3,21201,-2,1,-2,1106,0,263,21202,-3,1,-3,109,-4,2105,1,0,109,4,21101,1,0,-3,21102,0,1,-2,20207,-2,67,-1,1206,-1,342,1202,-2,2,332,101,1,332,332,1,68,332,332,22002,0,-3,-3,21201,-2,1,-2,1105,1,312,21201,-3,0,-3,109,-4,2105,1,0,109,1,101,1,68,359,20102,1,0,1,101,3,68,366,21002,0,1,2,21102,1,376,0,1105,1,436,21202,1,1,0,109,-1,2106,0,0,1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288,1048576,2097152,4194304,8388608,16777216,33554432,67108864,134217728,268435456,536870912,1073741824,2147483648,4294967296,8589934592,17179869184,34359738368,68719476736,137438953472,274877906944,549755813888,1099511627776,2199023255552,4398046511104,8796093022208,17592186044416,35184372088832,70368744177664,140737488355328,281474976710656,562949953421312,1125899906842624,109,8,21202,-6,10,-5,22207,-7,-5,-5,1205,-5,521,21101,0,0,-4,21101,0,0,-3,21102,51,1,-2,21201,-2,-1,-2,1201,-2,385,470,21001,0,0,-1,21202,-3,2,-3,22207,-7,-1,-5,1205,-5,496,21201,-3,1,-3,22102,-1,-1,-5,22201,-7,-5,-7,22207,-3,-6,-5,1205,-5,515,22102,-1,-6,-5,22201,-3,-5,-3,22201,-1,-4,-4,1205,-2,461,1106,0,547,21101,-1,0,-4,21202,-6,-1,-6,21207,-7,0,-5,1205,-5,547,22201,-7,-6,-7,21201,-4,1,-4,1105,1,529,21201,-4,0,-7,109,-8,2106,0,0,109,1,101,1,68,564,20101,0,0,0,109,-1,2106,0,0,1101,0,96059,66,1102,1,5,67,1101,0,598,68,1101,0,302,69,1101,0,1,71,1101,608,0,72,1106,0,73,0,0,0,0,0,0,0,0,0,0,29,96377,1102,1,25589,66,1102,1,1,67,1101,637,0,68,1102,556,1,69,1102,1,1,71,1102,639,1,72,1105,1,73,1,-11,11,381354,1101,0,38861,66,1102,1,2,67,1102,1,668,68,1101,302,0,69,1102,1,1,71,1102,672,1,72,1105,1,73,0,0,0,0,21,40063,1102,10091,1,66,1102,1,1,67,1102,1,701,68,1101,556,0,69,1102,1,1,71,1102,703,1,72,1105,1,73,1,41,5,14897,1101,69697,0,66,1101,4,0,67,1101,732,0,68,1102,253,1,69,1101,1,0,71,1101,0,740,72,1105,1,73,0,0,0,0,0,0,0,0,7,24281,1102,1,72893,66,1101,0,1,67,1102,1,769,68,1102,556,1,69,1101,0,3,71,1101,771,0,72,1105,1,73,1,13,44,248277,11,190677,19,15556,1101,66851,0,66,1101,2,0,67,1101,804,0,68,1102,302,1,69,1101,0,1,71,1102,1,808,72,1106,0,73,0,0,0,0,34,409468,1102,46681,1,66,1101,0,1,67,1102,837,1,68,1101,0,556,69,1102,3,1,71,1102,1,839,72,1105,1,73,1,5,39,57487,39,114974,38,95138,1101,7883,0,66,1102,1,1,67,1101,872,0,68,1101,0,556,69,1102,1,1,71,1102,874,1,72,1105,1,73,1,677,43,192118,1102,1,84089,66,1101,0,1,67,1101,0,903,68,1102,1,556,69,1102,0,1,71,1102,1,905,72,1106,0,73,1,1634,1101,20297,0,66,1102,1,1,67,1101,0,932,68,1102,1,556,69,1102,1,1,71,1101,934,0,72,1106,0,73,1,967,3,23362,1102,1,95597,66,1102,1,1,67,1102,1,963,68,1102,556,1,69,1102,1,1,71,1102,1,965,72,1106,0,73,1,-231,19,11667,1101,45181,0,66,1102,1,1,67,1101,994,0,68,1102,1,556,69,1101,0,1,71,1101,996,0,72,1105,1,73,1,125,39,172461,1102,19087,1,66,1102,1,1,67,1101,0,1025,68,1102,556,1,69,1101,1,0,71,1101,1027,0,72,1106,0,73,1,51,30,103991,1102,56093,1,66,1102,1,1,67,1102,1056,1,68,1101,0,556,69,1101,1,0,71,1102,1,1058,72,1105,1,73,1,10181,12,18061,1102,69857,1,66,1102,1,1,67,1102,1,1087,68,1101,0,556,69,1101,0,0,71,1101,1089,0,72,1105,1,73,1,1387,1101,53881,0,66,1101,1,0,67,1101,1116,0,68,1102,556,1,69,1102,1,1,71,1102,1,1118,72,1106,0,73,1,37,43,288177,1102,1,11681,66,1101,3,0,67,1102,1147,1,68,1102,1,302,69,1101,0,1,71,1102,1,1153,72,1105,1,73,0,0,0,0,0,0,34,307101,1102,1,24281,66,1102,1,2,67,1102,1,1182,68,1102,351,1,69,1101,1,0,71,1101,1186,0,72,1105,1,73,0,0,0,0,255,65183,1102,1,1093,66,1101,2,0,67,1102,1,1215,68,1101,302,0,69,1102,1,1,71,1101,0,1219,72,1105,1,73,0,0,0,0,31,24671,1102,82759,1,66,1102,4,1,67,1102,1,1248,68,1101,0,302,69,1101,1,0,71,1102,1,1256,72,1106,0,73,0,0,0,0,0,0,0,0,34,204734,1101,100279,0,66,1102,1,1,67,1101,1285,0,68,1102,556,1,69,1102,2,1,71,1101,0,1287,72,1105,1,73,1,2,38,190276,38,237845,1102,1,47569,66,1101,0,6,67,1101,0,1318,68,1102,1,302,69,1102,1,1,71,1102,1330,1,72,1105,1,73,0,0,0,0,0,0,0,0,0,0,0,0,7,48562,1102,13163,1,66,1101,0,1,67,1102,1359,1,68,1101,556,0,69,1102,1,1,71,1102,1361,1,72,1106,0,73,1,293,5,44691,1102,1,101287,66,1102,1,1,67,1102,1,1390,68,1101,0,556,69,1101,0,1,71,1102,1392,1,72,1106,0,73,1,97,11,317795,1101,24671,0,66,1101,0,2,67,1102,1,1421,68,1101,0,302,69,1102,1,1,71,1102,1425,1,72,1105,1,73,0,0,0,0,47,133702,1102,77687,1,66,1101,2,0,67,1102,1,1454,68,1102,1,302,69,1102,1,1,71,1102,1,1458,72,1106,0,73,0,0,0,0,43,384236,1102,78367,1,66,1102,1,1,67,1101,1487,0,68,1101,0,556,69,1101,2,0,71,1101,0,1489,72,1106,0,73,1,10,39,229948,38,47569,1102,1,3061,66,1101,1,0,67,1101,1520,0,68,1102,556,1,69,1101,0,1,71,1101,1522,0,72,1105,1,73,1,523,30,207982,1101,33181,0,66,1102,3,1,67,1101,1551,0,68,1101,0,302,69,1101,0,1,71,1101,1557,0,72,1106,0,73,0,0,0,0,0,0,24,278788,1101,102181,0,66,1101,1,0,67,1102,1586,1,68,1101,0,556,69,1101,1,0,71,1102,1588,1,72,1106,0,73,1,378,44,165518,1101,65183,0,66,1101,0,1,67,1102,1617,1,68,1102,556,1,69,1101,0,6,71,1101,0,1619,72,1106,0,73,1,25255,29,192754,18,141326,18,211989,37,33181,37,66362,37,99543,1101,88799,0,66,1102,1,1,67,1102,1,1658,68,1101,556,0,69,1101,0,1,71,1101,1660,0,72,1106,0,73,1,160,38,285414,1102,96377,1,66,1102,1,2,67,1101,1689,0,68,1102,1,302,69,1101,0,1,71,1102,1,1693,72,1106,0,73,0,0,0,0,24,139394,1101,70663,0,66,1102,3,1,67,1101,0,1722,68,1101,0,302,69,1102,1,1,71,1102,1728,1,72,1106,0,73,0,0,0,0,0,0,24,209091,1102,104173,1,66,1101,1,0,67,1101,0,1757,68,1101,556,0,69,1102,1,1,71,1101,1759,0,72,1106,0,73,1,31,44,82759,1101,92951,0,66,1102,1,1,67,1101,0,1788,68,1101,556,0,69,1101,0,12,71,1102,1,1790,72,1106,0,73,1,1,44,331036,30,311973,4,2186,31,49342,47,66851,3,11681,12,36122,6,77722,21,80126,35,155374,43,480295,19,7778,1102,40063,1,66,1102,2,1,67,1101,0,1841,68,1101,302,0,69,1102,1,1,71,1102,1,1845,72,1106,0,73,0,0,0,0,35,77687,1102,1,74377,66,1101,1,0,67,1101,0,1874,68,1102,1,556,69,1101,2,0,71,1101,1876,0,72,1105,1,73,1,19,11,127118,19,3889,1102,3889,1,66,1102,4,1,67,1102,1,1907,68,1102,302,1,69,1102,1,1,71,1101,1915,0,72,1106,0,73,0,0,0,0,0,0,0,0,18,70663,1102,1,8353,66,1102,1,1,67,1102,1944,1,68,1101,0,556,69,1101,0,1,71,1101,0,1946,72,1106,0,73,1,-52,3,35043,1101,0,31477,66,1101,0,1,67,1102,1,1975,68,1101,0,556,69,1101,0,0,71,1102,1977,1,72,1106,0,73,1,1229,1102,32159,1,66,1102,1,1,67,1101,2004,0,68,1102,556,1,69,1101,4,0,71,1102,1,2006,72,1105,1,73,1,7,5,29794,5,59588,11,63559,43,96059,1101,0,103991,66,1102,1,3,67,1101,2041,0,68,1102,302,1,69,1101,0,1,71,1102,2047,1,72,1106,0,73,0,0,0,0,0,0,34,511835,1101,0,78157,66,1101,1,0,67,1102,2076,1,68,1102,556,1,69,1101,1,0,71,1102,2078,1,72,1106,0,73,1,-81047,4,1093,1102,57487,1,66,1101,0,4,67,1101,0,2107,68,1102,1,302,69,1101,0,1,71,1102,2115,1,72,1106,0,73,0,0,0,0,0,0,0,0,38,142707,1102,18061,1,66,1101,0,2,67,1102,2144,1,68,1102,302,1,69,1101,1,0,71,1102,1,2148,72,1105,1,73,0,0,0,0,6,38861,1102,102367,1,66,1102,5,1,67,1101,0,2177,68,1102,253,1,69,1101,1,0,71,1102,1,2187,72,1105,1,73,0,0,0,0,0,0,0,0,0,0,11,254236,1102,1,63559,66,1101,6,0,67,1102,1,2216,68,1102,1,302,69,1102,1,1,71,1102,2228,1,72,1106,0,73,0,0,0,0,0,0,0,0,0,0,0,0,24,69697,1102,14897,1,66,1101,0,4,67,1101,2257,0,68,1101,0,302,69,1101,0,1,71,1102,2265,1,72,1106,0,73,0,0,0,0,0,0,0,0,34,102367 diff --git a/aoc2019/input/day24.in b/aoc2019/input/day24.in new file mode 100644 index 0000000..5126c4f --- /dev/null +++ b/aoc2019/input/day24.in @@ -0,0 +1,5 @@ +##.#. +##.#. +##.## +.#### +.#... diff --git a/aoc2019/input/day25.in b/aoc2019/input/day25.in new file mode 100644 index 0000000..b060a82 --- /dev/null +++ b/aoc2019/input/day25.in @@ -0,0 +1 @@ +109,4779,21101,3124,0,1,21102,1,13,0,1105,1,1424,21102,166,1,1,21101,0,24,0,1105,1,1234,21101,31,0,0,1105,1,1984,1105,1,13,6,4,3,2,52,51,21,4,28,56,55,3,19,-9,-10,47,89,88,90,90,6,77,73,85,71,1,76,68,63,65,22,-27,70,76,81,87,5,105,105,107,108,95,4,97,92,109,109,5,110,105,110,108,95,4,115,96,109,109,13,-3,59,101,85,92,97,13,84,80,92,78,34,-15,26,-16,46,88,72,79,84,0,72,76,-3,85,74,79,75,-8,64,68,75,57,65,70,64,66,72,8,-41,32,-22,56,77,82,-4,60,76,62,70,-2,74,-11,55,52,68,67,73,56,60,52,-20,44,56,66,-24,48,58,42,49,54,-16,-53,10,0,56,99,96,95,82,94,83,45,-9,23,-13,61,85,88,74,71,82,73,79,73,89,67,65,-4,62,73,70,69,56,68,57,2,-35,24,-14,64,85,90,4,70,67,79,7,83,-2,68,75,-5,78,65,57,75,-10,76,53,76,0,-37,31,-21,57,78,83,-3,64,74,72,0,76,-9,73,58,57,-13,70,57,49,67,-18,54,64,48,55,-23,48,44,56,42,-14,-51,14,-4,74,95,100,14,97,77,86,79,9,92,79,75,5,27,-17,61,82,87,1,68,78,76,4,80,-5,66,58,78,60,-10,73,60,52,70,-15,57,67,51,58,-6,-43,14,-4,74,95,100,14,81,94,90,90,9,92,79,75,5,60,-50,23,42,38,-32,38,39,30,42,47,-38,30,36,28,25,41,38,34,31,18,23,29,19,33,-52,20,29,-55,27,27,27,8,15,-61,22,16,-64,24,13,18,-54,-69,-70,-14,7,12,-74,-8,-11,1,-71,5,-80,-4,-3,3,-15,-84,-85,-109,29,-19,59,80,85,-1,82,62,71,64,-6,77,64,60,-10,62,66,57,59,63,57,67,51,-19,56,58,57,57,-10,-47,44,-34,39,58,54,-16,60,61,57,64,48,56,-23,52,40,60,38,-28,44,53,-31,55,32,55,-35,48,42,41,-39,32,38,42,-42,-44,12,33,38,-48,28,19,25,32,-52,-76,-77,59,-49,13,55,-30,42,51,-33,49,50,32,31,31,39,36,48,-42,24,35,32,34,29,21,35,19,25,37,-53,14,10,26,18,-57,-59,-3,18,23,-63,1,17,3,-67,1,-4,14,-2,6,-73,-8,14,-76,-12,-78,-40,2,4,-13,-82,-106,-107,35,-25,53,74,79,0,74,60,-10,65,53,72,64,52,56,52,50,-19,53,57,62,56,-24,58,54,38,39,40,-29,-31,2,56,35,-34,-58,-59,138,-128,-74,-108,-33,-31,-26,-44,-101,-114,-33,-37,-51,-39,-35,-47,-54,-122,-37,-45,-52,-59,-58,-128,-46,-65,-42,-49,-133,-132,-102,-60,-68,-56,-55,-139,-141,-106,-61,-65,-72,-78,-64,-148,-70,-72,-151,-68,-81,-81,-72,-156,-74,-86,-86,-80,-161,-97,-81,-95,-165,-94,-98,-103,-83,-97,-102,-90,-173,-90,-103,-111,-99,-178,-95,-108,-112,-182,-115,-115,-101,-117,-120,-104,-120,-122,-191,-106,-128,-118,-110,-127,-196,-196,-199,-135,-123,-134,-203,-115,-126,-121,-207,-143,-127,-141,-211,-143,-139,-145,-148,-132,-148,-150,-219,-154,-156,-155,-148,-224,-141,-147,-227,-144,-157,-161,-231,-165,-161,-165,-168,-161,-157,-159,-166,-162,-157,-228,-265,138,-128,-74,-108,-33,-31,-26,-44,-101,-114,-33,-37,-51,-39,-35,-47,-54,-122,-37,-45,-52,-59,-58,-128,-46,-65,-42,-49,-133,-132,-102,-60,-68,-56,-55,-139,-141,-106,-61,-65,-72,-78,-64,-148,-70,-72,-151,-68,-81,-81,-72,-156,-74,-86,-86,-80,-161,-97,-81,-95,-165,-90,-94,-97,-97,-86,-102,-90,-173,-90,-103,-111,-99,-178,-95,-108,-112,-182,-115,-115,-101,-117,-120,-104,-120,-122,-191,-106,-128,-118,-110,-127,-196,-196,-199,-135,-123,-134,-203,-115,-126,-121,-207,-143,-127,-141,-211,-143,-139,-145,-148,-132,-148,-150,-219,-154,-156,-155,-148,-224,-141,-147,-227,-144,-157,-161,-231,-165,-161,-165,-168,-161,-157,-159,-166,-162,-157,-228,-265,263,-253,-199,-233,-158,-156,-151,-169,-226,-239,-158,-162,-176,-164,-160,-172,-179,-247,-162,-170,-177,-184,-183,-253,-171,-190,-167,-174,-258,-257,-227,-183,-197,-187,-175,-182,-193,-184,-268,-202,-191,-194,-192,-197,-205,-191,-207,-276,-278,-222,-201,-196,-282,-206,-219,-196,-286,-207,-206,-210,-223,-222,-223,-225,-280,-293,-296,-232,-220,-231,-300,-212,-223,-218,-304,-236,-228,-223,-239,-227,-310,-227,-240,-244,-314,-248,-237,-250,-243,-239,-247,-237,-308,-345,-273,-260,-248,-243,-263,-329,-252,-252,-248,-260,-267,-266,-253,-337,-249,-260,-255,-259,-342,-260,-267,-280,-270,-271,-348,-281,-268,-272,-279,-285,-342,-355,-280,-278,-279,-284,-277,-361,-282,-278,-274,-275,-290,-298,-300,-369,-300,-292,-290,-373,-309,-375,-299,-298,-301,-310,-302,-297,-370,-383,-302,-316,-321,-311,-315,-299,-321,-308,-392,-306,-322,-330,-312,-397,-326,-334,-317,-401,-330,-338,-324,-325,-337,-329,-339,-341,-398,-411,-347,-335,-346,-415,-334,-352,-350,-346,-341,-338,-422,-334,-345,-340,-344,-427,-345,-357,-357,-351,-432,-365,-361,-353,-367,-370,-354,-363,-351,-427,-464,-441,-397,-373,-434,-447,-376,-380,-374,-375,-373,-452,-454,-398,-377,-372,-458,-376,-388,-382,-377,-387,-396,-465,-400,-398,-468,-404,-404,-395,-403,-473,-390,-396,-476,-406,-409,-395,-480,-408,-404,-483,-418,-396,-486,-403,-399,-409,-417,-413,-421,-493,37,-5,73,71,-8,75,62,58,-12,62,55,74,64,48,50,-19,45,63,-22,61,48,44,-26,50,37,44,48,-31,33,40,48,41,43,30,37,-25,-38,-63,0,0,109,7,21101,0,0,-2,22208,-2,-5,-1,1205,-1,1169,22202,-2,-4,1,22201,1,-6,1,21201,-2,0,2,21102,1,1162,0,2105,1,-3,21201,-2,1,-2,1105,1,1136,109,-7,2105,1,0,109,6,2102,1,-5,1182,20102,1,0,-2,21102,0,1,-3,21201,-5,1,-5,22208,-3,-2,-1,1205,-1,1229,2201,-5,-3,1205,20102,1,0,1,21201,-3,0,2,22101,0,-2,3,21101,0,1222,0,2106,0,-4,21201,-3,1,-3,1105,1,1192,109,-6,2105,1,0,109,2,21201,-1,0,1,21101,0,1256,2,21101,0,1251,0,1106,0,1174,109,-2,2106,0,0,109,5,22201,-4,-3,-1,22201,-2,-1,-1,204,-1,109,-5,2105,1,0,109,3,2101,0,-2,1280,1006,0,1303,104,45,104,32,1201,-1,66,1292,20101,0,0,1,21102,1301,1,0,1106,0,1234,104,10,109,-3,2105,1,0,0,0,109,2,1201,-1,0,1309,1101,0,0,1308,21101,0,4601,1,21102,1,13,2,21101,4,0,3,21101,0,1353,4,21101,0,1343,0,1106,0,1130,20101,0,1308,-1,109,-2,2106,0,0,96,109,3,1201,-2,0,1360,20008,0,1309,-1,1206,-1,1419,1005,1308,1398,1101,1,0,1308,21008,1309,-1,-1,1206,-1,1387,21102,106,1,1,1106,0,1391,21102,1,92,1,21101,1398,0,0,1105,1,1234,104,45,104,32,1201,-2,1,1407,21002,0,1,1,21102,1,1417,0,1106,0,1234,104,10,109,-3,2105,1,0,109,3,2102,1,-2,1128,21101,34,0,1,21102,1441,1,0,1105,1,1234,1001,1128,0,1447,20101,0,0,1,21101,1456,0,0,1105,1,1234,21101,41,0,1,21101,1467,0,0,1106,0,1234,1001,1128,1,1473,20101,0,0,1,21101,1482,0,0,1105,1,1234,21101,46,0,1,21102,1,1493,0,1106,0,1234,21001,1128,3,1,21101,4,0,2,21102,1,1,3,21101,1273,0,4,21101,1516,0,0,1105,1,1130,21002,1128,1,1,21101,1527,0,0,1105,1,1310,1001,1128,2,1532,21002,0,1,-1,1206,-1,1545,21102,1545,1,0,2106,0,-1,109,-3,2105,1,0,109,0,99,109,2,1102,0,1,1550,21101,4601,0,1,21101,13,0,2,21102,1,4,3,21102,1,1664,4,21101,1582,0,0,1106,0,1130,2,2486,1352,1551,1102,0,1,1552,21001,1550,0,1,21102,1,33,2,21101,0,1702,3,21102,1,1609,0,1105,1,2722,21007,1552,0,-1,1205,-1,1630,20107,0,1552,-1,1205,-1,1637,21102,1630,1,0,1105,1,1752,21101,0,548,1,1105,1,1641,21102,1,687,1,21102,1,1648,0,1105,1,1234,21102,1,4457,1,21102,1,1659,0,1105,1,1424,109,-2,2106,0,0,109,4,21202,-2,-1,-2,1202,-3,1,1675,21008,0,-1,-1,1206,-1,1697,1201,-3,2,1687,20101,-27,0,-3,22201,-3,-2,-3,2001,1550,-3,1550,109,-4,2106,0,0,109,5,21008,1552,0,-1,1206,-1,1747,1201,-3,1901,1717,20101,0,0,-2,1205,-4,1736,20207,-2,1551,-1,1205,-1,1747,1102,-1,1,1552,1106,0,1747,22007,1551,-2,-1,1205,-1,1747,1101,1,0,1552,109,-5,2106,0,0,109,1,21101,0,826,1,21101,1765,0,0,1105,1,1234,21002,1550,1,1,21101,0,1776,0,1105,1,2863,21102,1090,1,1,21101,1787,0,0,1105,1,1234,99,1105,1,1787,109,-1,2105,1,0,109,1,21102,1,512,1,21102,1809,1,0,1105,1,1234,99,1106,0,1809,109,-1,2105,1,0,109,1,1102,1,1,1129,109,-1,2105,1,0,109,1,21102,377,1,1,21101,1842,0,0,1106,0,1234,1106,0,1831,109,-1,2106,0,0,109,1,21102,407,1,1,21101,0,1863,0,1106,0,1234,99,1106,0,1863,109,-1,2105,1,0,109,1,21102,452,1,1,21101,0,1885,0,1106,0,1234,99,1106,0,1885,109,-1,2106,0,0,1941,1947,1953,1958,1965,1972,1978,4760,4557,5066,5021,5217,4700,4887,5216,5186,4670,5148,5088,5222,5161,5049,4612,4644,5135,5028,4603,5069,4734,4513,4819,4558,5025,4593,4652,4643,4576,4719,4992,4725,2281,2468,2418,2450,2487,2125,2505,5,95,108,104,104,23,5,96,91,108,108,1,4,101,105,112,3,6,104,104,106,107,94,-1,6,109,104,109,107,94,-1,5,111,91,100,93,23,5,114,95,108,108,1,109,3,21102,1993,1,0,1105,1,2634,1006,1129,2010,21101,316,0,1,21102,2007,1,0,1105,1,1234,1105,1,2076,21101,0,0,-1,1201,-1,1894,2020,20102,1,0,1,21101,0,0,2,21101,0,0,3,21102,1,2037,0,1105,1,2525,1206,1,2054,1201,-1,1934,2050,21101,0,2051,0,106,0,0,1106,0,2076,21201,-1,1,-1,21207,-1,7,-2,1205,-2,2014,21102,1,177,1,21102,2076,1,0,1106,0,1234,109,-3,2106,0,0,109,3,2001,1128,-2,2089,20102,1,0,-1,1205,-1,2108,21101,201,0,1,21102,2105,1,0,1105,1,1234,1106,0,2119,22102,1,-1,1,21101,0,2119,0,1106,0,1424,109,-3,2106,0,0,0,109,1,1101,0,0,2124,21101,0,4601,1,21101,13,0,2,21101,4,0,3,21102,2173,1,4,21102,1,2154,0,1106,0,1130,1005,2124,2168,21102,226,1,1,21101,0,2168,0,1106,0,1234,109,-1,2105,1,0,109,3,1005,2124,2275,1201,-2,0,2183,20008,0,1128,-1,1206,-1,2275,1201,-2,1,2194,21001,0,0,-1,22102,1,-1,1,21101,5,0,2,21101,1,0,3,21102,1,2216,0,1105,1,2525,1206,1,2275,21101,0,258,1,21102,1,2230,0,1105,1,1234,21201,-1,0,1,21101,0,2241,0,1106,0,1234,104,46,104,10,1101,0,1,2124,1201,-2,0,2256,1101,-1,0,0,1201,-2,3,2262,21002,0,1,-1,1206,-1,2275,21102,1,2275,0,2106,0,-1,109,-3,2106,0,0,0,109,1,1102,0,1,2280,21102,4601,1,1,21101,0,13,2,21102,1,4,3,21102,2329,1,4,21101,0,2310,0,1106,0,1130,1005,2280,2324,21102,1,273,1,21101,0,2324,0,1106,0,1234,109,-1,2105,1,0,109,3,1005,2280,2413,1201,-2,0,2339,21008,0,-1,-1,1206,-1,2413,1201,-2,1,2350,21002,0,1,-1,22102,1,-1,1,21102,1,5,2,21102,1,1,3,21102,2372,1,0,1105,1,2525,1206,1,2413,21102,301,1,1,21101,0,2386,0,1105,1,1234,21201,-1,0,1,21101,2397,0,0,1105,1,1234,104,46,104,10,1101,1,0,2280,1201,-2,0,2412,102,1,1128,0,109,-3,2106,0,0,109,1,21102,-1,1,1,21102,2431,1,0,1106,0,1310,1205,1,2445,21101,133,0,1,21102,1,2445,0,1106,0,1234,109,-1,2105,1,0,109,1,21101,3,0,1,21102,1,2463,0,1105,1,2081,109,-1,2105,1,0,109,1,21102,1,4,1,21102,2481,1,0,1106,0,2081,109,-1,2106,0,0,54,109,1,21102,5,1,1,21102,1,2500,0,1106,0,2081,109,-1,2106,0,0,109,1,21102,1,6,1,21102,1,2518,0,1105,1,2081,109,-1,2105,1,0,0,0,109,5,2101,0,-3,2523,1102,1,1,2524,21202,-4,1,1,21101,0,2585,2,21101,2550,0,0,1105,1,1174,1206,-2,2576,1202,-4,1,2558,2001,0,-3,2566,101,3094,2566,2566,21008,0,-1,-1,1205,-1,2576,1102,0,1,2524,20101,0,2524,-4,109,-5,2106,0,0,109,5,22201,-4,-3,-4,22201,-4,-2,-4,21208,-4,10,-1,1206,-1,2606,21102,1,-1,-4,201,-3,2523,2615,1001,2615,3094,2615,21002,0,1,-1,22208,-4,-1,-1,1205,-1,2629,1102,0,1,2524,109,-5,2105,1,0,109,4,21101,0,3094,1,21102,1,30,2,21102,1,1,3,21101,2706,0,4,21101,0,2659,0,1106,0,1130,21101,0,0,-3,203,-2,21208,-2,10,-1,1205,-1,2701,21207,-2,0,-1,1205,-1,2663,21207,-3,29,-1,1206,-1,2663,2101,3094,-3,2693,1201,-2,0,0,21201,-3,1,-3,1105,1,2663,109,-4,2105,1,0,109,2,1202,-1,1,2715,1102,-1,1,0,109,-2,2105,1,0,0,109,5,2101,0,-2,2721,21207,-4,0,-1,1206,-1,2739,21101,0,0,-4,21201,-4,0,1,22101,0,-3,2,21102,1,1,3,21102,1,2758,0,1106,0,2763,109,-5,2106,0,0,109,6,21207,-4,1,-1,1206,-1,2786,22207,-5,-3,-1,1206,-1,2786,21202,-5,1,-5,1105,1,2858,22102,1,-5,1,21201,-4,-1,2,21202,-3,2,3,21102,2805,1,0,1105,1,2763,21201,1,0,-5,21102,1,1,-2,22207,-5,-3,-1,1206,-1,2824,21101,0,0,-2,22202,-3,-2,-3,22107,0,-4,-1,1206,-1,2850,21201,-2,0,1,21201,-4,-1,2,21101,2850,0,0,105,1,2721,21202,-3,-1,-3,22201,-5,-3,-5,109,-6,2106,0,0,109,3,21208,-2,0,-1,1205,-1,2902,21207,-2,0,-1,1205,-1,2882,1106,0,2888,104,45,21202,-2,-1,-2,21201,-2,0,1,21102,2899,1,0,1105,1,2909,1105,1,2904,104,48,109,-3,2106,0,0,109,4,21202,-3,1,1,21102,10,1,2,21102,2926,1,0,1106,0,3010,21201,1,0,-2,21202,2,1,-1,1206,-2,2948,22101,0,-2,1,21101,0,2948,0,1106,0,2909,22101,48,-1,-1,204,-1,109,-4,2106,0,0,1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288,1048576,2097152,4194304,8388608,16777216,33554432,67108864,134217728,268435456,536870912,1073741824,2147483648,4294967296,8589934592,17179869184,34359738368,68719476736,137438953472,274877906944,549755813888,1099511627776,2199023255552,4398046511104,8796093022208,17592186044416,35184372088832,70368744177664,140737488355328,281474976710656,562949953421312,1125899906842624,109,8,21102,0,1,-4,21102,1,0,-3,21102,1,51,-2,21201,-2,-1,-2,1201,-2,2959,3033,21002,0,1,-1,21202,-3,2,-3,22207,-7,-1,-5,1205,-5,3059,21201,-3,1,-3,22102,-1,-1,-5,22201,-7,-5,-7,22207,-3,-6,-5,1205,-5,3078,22102,-1,-6,-5,22201,-3,-5,-3,22201,-1,-4,-4,1205,-2,3024,22101,0,-4,-7,22101,0,-3,-6,109,-8,2105,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3131,3143,0,3396,3252,0,3619,11,61,105,95,94,17,50,97,83,78,79,83,108,-19,2,7,-79,-9,-2,2,-83,-11,-7,-86,-3,-16,-7,-11,-6,-21,-21,-94,-30,-96,-25,-19,-23,-31,-101,-29,-25,-104,-21,-34,-38,-108,-39,-34,-32,-33,-31,-114,-43,-47,-35,-49,-105,-120,-69,-43,-123,-49,-56,-57,-47,-128,-40,-51,-46,-50,-133,-51,-63,-63,-57,-138,-69,-58,-62,-65,-143,-79,-69,-63,-68,-148,-79,-68,-82,-83,-63,-81,-77,-85,-145,-158,-75,-88,-92,-162,-91,-85,-89,-97,-167,-96,-104,-87,-171,-106,-104,-105,-97,-176,-94,-109,-114,-104,-112,-114,-169,3259,3267,0,0,3316,0,3124,7,76,108,102,104,86,91,88,48,36,55,51,-19,46,58,66,46,59,-25,48,58,55,55,-30,36,47,45,50,30,37,41,-38,38,39,41,27,-43,22,34,42,22,35,-35,-50,-51,-2,16,13,30,26,26,15,27,9,15,27,-49,3323,3335,0,4219,4024,0,3252,11,68,86,102,87,99,102,80,98,92,94,100,60,24,43,39,51,37,-33,31,47,33,-37,27,-39,30,28,45,-43,40,24,30,22,35,18,29,29,17,30,-27,-55,28,15,11,30,-53,21,7,-63,1,11,10,-67,-2,10,6,13,-3,-5,-74,-7,3,10,0,-67,-80,3,-10,-4,1,-14,-14,-73,3403,3412,0,3708,3492,3124,0,8,59,102,104,103,93,87,97,99,79,5,24,20,-50,26,17,31,11,21,-56,30,7,17,16,22,-62,2,14,3,-66,17,4,0,-70,6,-3,11,-9,1,-76,-7,-2,0,-1,1,-82,-18,-2,-16,-86,-4,-12,-16,-19,-19,-8,-17,-5,-95,-28,-24,-28,-29,-31,-19,-33,-25,-20,-105,-39,-28,-32,-30,-28,-28,-98,-113,-67,-33,-116,-52,-36,-50,-120,-37,-50,-54,-35,-94,3499,3508,0,3758,3564,0,3396,8,72,88,105,104,85,90,87,100,55,29,48,44,63,-20,54,40,-30,34,-32,43,39,49,48,39,31,-39,44,46,31,40,40,44,-46,18,30,19,-50,32,32,12,28,29,17,21,13,-59,24,18,-62,13,15,14,9,-67,-3,7,6,-71,-7,3,-1,0,-7,-63,3571,3578,0,3886,0,0,3492,6,59,107,91,88,90,90,40,38,70,68,58,-12,66,56,-15,68,55,51,-19,47,44,44,50,54,44,58,56,-28,54,39,38,45,-33,50,44,-36,35,27,47,29,-41,38,36,43,24,36,-33,3626,3635,0,0,3124,0,3827,8,75,96,89,96,20,53,83,106,72,11,44,38,37,35,37,38,36,-48,17,29,33,20,-53,-4,14,12,-44,-12,20,23,8,6,-63,-14,4,7,11,0,0,-1,11,-72,4,-5,-7,-3,-10,-5,-1,-11,-81,-17,-5,-16,-85,-4,-18,-17,-4,-14,-26,-10,-93,-12,-26,-23,-19,-30,-30,-31,-19,-102,-26,-35,-37,-33,-40,-35,-31,-41,-97,3715,3723,0,0,4294,3396,3982,7,76,108,88,88,97,89,102,34,48,66,69,73,62,62,61,73,3,72,61,77,55,53,-2,-17,34,53,49,68,-15,59,45,-25,39,49,48,-29,39,46,48,51,55,-21,3765,3786,0,0,0,3492,0,20,51,84,80,93,8,62,88,70,84,83,75,79,71,-1,33,66,74,79,63,75,40,32,70,77,-11,57,63,69,54,-16,51,61,-19,69,58,63,-23,63,57,39,53,-28,51,52,38,51,36,44,49,47,-37,41,39,-40,43,30,26,-44,26,33,-16,3834,3857,0,4097,3619,0,4162,22,50,88,92,7,41,77,83,70,81,77,65,83,67,-3,34,74,79,71,76,56,63,67,28,55,82,79,70,72,78,85,9,-4,68,78,0,75,-9,73,73,61,63,62,-15,71,62,64,56,53,57,49,-9,3893,3904,0,0,0,3564,0,10,68,86,106,92,89,82,100,88,93,91,77,6,38,18,36,36,33,-25,-52,-2,30,27,9,21,10,10,8,-47,-62,-15,12,4,-1,16,1,-69,13,14,8,7,2,14,-76,0,-9,-14,3,4,0,-14,-7,-16,-8,-3,-5,-89,-20,-9,-13,-16,-94,-25,-23,-27,-14,-10,-100,-18,-18,-38,-22,-22,-106,-23,-29,-109,-28,-42,-45,-48,-38,-42,-50,-35,-53,-35,-51,-107,3989,3997,0,0,3708,0,0,7,68,97,107,89,93,89,97,26,43,91,73,85,91,85,72,72,76,68,3,78,-6,63,74,60,59,79,57,0,54,67,57,52,50,-5,4031,4040,0,0,4365,0,3316,8,64,102,98,100,88,88,85,92,56,27,54,51,42,51,49,39,-31,51,36,35,42,47,-37,46,40,-40,31,23,43,25,-45,30,22,22,35,-50,22,32,-53,25,23,-56,27,14,10,-60,-22,11,2,14,19,-66,-28,14,4,-2,-71,11,-4,10,9,-3,1,-7,-65,4104,4127,0,0,0,3827,0,22,65,74,90,87,6,41,86,76,88,70,0,44,63,70,74,79,63,71,57,69,57,58,34,39,81,-4,60,74,73,61,56,72,72,-12,71,65,-15,50,52,-18,68,59,61,53,50,54,46,-26,51,51,53,47,34,44,43,55,-21,4169,4183,0,0,3827,0,0,13,54,100,86,103,15,63,98,77,93,94,78,90,90,35,49,68,64,-6,59,61,59,73,-11,53,69,55,-15,49,59,58,-19,64,58,57,-23,59,52,39,49,48,-29,40,48,50,-33,55,44,49,-23,4226,4238,0,0,0,3316,0,11,72,87,92,87,95,83,84,14,57,77,77,55,34,55,60,-26,56,41,40,-30,38,54,40,34,34,42,30,31,-39,32,28,40,26,-44,34,24,-47,32,33,29,33,27,31,35,25,13,-57,22,20,16,28,15,6,18,-65,2,2,15,4,1,7,-72,14,5,7,-1,-63,4301,4313,0,0,0,0,3708,11,58,98,90,91,95,85,84,96,86,90,82,51,38,59,64,-22,60,45,44,-26,38,-28,58,42,42,52,36,32,44,29,45,30,-39,47,32,42,29,-44,35,30,18,30,34,-50,19,27,29,-54,-4,24,25,15,19,11,7,20,16,9,3,-66,19,-50,-55,4372,4380,0,4457,0,0,4024,7,65,89,99,98,108,85,108,76,8,27,27,36,-48,16,32,18,13,-53,18,10,27,-57,8,10,9,17,-62,16,16,19,7,10,5,21,-1,-3,-72,-3,5,7,-76,6,1,-2,-11,3,-10,-10,-6,-14,-59,-87,1,-10,-5,-84,-10,-24,-94,-21,-11,-14,-14,-99,-22,-22,-18,-103,-23,-20,-33,-23,-39,-109,-27,-26,-30,-44,-114,-28,-44,-52,-34,-105,4464,4484,0,0,4556,4365,0,19,64,81,78,95,91,81,91,95,5,39,75,71,68,75,79,77,70,74,79,71,2,38,-41,42,29,25,-45,32,22,40,35,-50,31,27,26,23,-43,-56,8,-58,21,22,8,21,20,21,17,3,-54,15,0,8,12,1,11,-1,11,-7,-77,-8,-3,-1,-2,0,-83,3,-12,-10,-11,-88,-3,-21,-9,-19,-23,-5,-95,-7,-18,-13,-17,-100,-28,-34,-34,-26,-21,-33,-23,-19,-95,4563,4588,1553,0,0,0,4457,24,56,89,75,88,87,88,84,70,13,50,67,75,79,68,78,66,78,60,-10,27,64,66,65,67,12,53,97,83,93,105,105,87,91,83,25,24,23,3564,4653,27,1796,4097,4664,28,1850,4024,4676,45,0,3252,4686,30,1818,3619,4706,31,1872,3492,4714,16777248,0,3886,4719,41,0,4365,4727,268435490,0,3708,4735,67108899,0,4294,4741,33554468,0,3316,4749,32805,0,4162,4760,1048614,0,3396,4765,39,1829,10,91,104,87,84,98,86,16,95,93,81,11,98,99,95,102,86,94,15,90,78,98,76,9,93,107,90,96,19,85,86,92,91,19,84,85,76,88,93,8,76,82,74,71,87,84,80,77,64,69,75,65,79,7,105,96,102,106,100,98,102,4,95,92,101,94,7,105,103,96,100,105,89,101,7,91,103,108,98,89,89,101,5,104,111,109,93,111,7,90,102,107,91,99,98,84,10,106,86,97,85,97,102,98,88,92,82,4,95,106,99,103,13,92,96,87,89,93,87,97,81,11,86,88,87,87 diff --git a/aoc2019/lib/Extensions.cs b/aoc2019/lib/Extensions.cs new file mode 100644 index 0000000..eb8c3cb --- /dev/null +++ b/aoc2019/lib/Extensions.cs @@ -0,0 +1,48 @@ +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; + +namespace aoc2019.lib +{ + public static class Extensions + { + public static IEnumerable> Permute(this IEnumerable list) + { + if (list.Count() == 1) return new[] {list}; + return list.SelectMany(t => Permute(list.Where(x => !x.Equals(t))), (v, p) => p.Prepend(v)); + } + + public static IEnumerable Chunk(this string str, int chunkSize) + { + for (var i = 0; i < str.Length; i += chunkSize) + yield return str.Substring(i, chunkSize); + } + + public static string ToDelimitedString(this IEnumerable enumerable, string delimiter = "") + { + return string.Join(delimiter, enumerable); + } + + public static IEnumerable Repeat(this IEnumerable sequence, int? count = null) + { + while (count == null || count-- > 0) + foreach (var item in sequence) + yield return item; + } + + /// + /// increased accuracy for stopwatch based on frequency. + /// + /// blog + /// details here + /// + /// + /// + /// + public static double ScaleMilliseconds(this Stopwatch stopwatch) + { + return 1_000 * stopwatch.ElapsedTicks / (double) Stopwatch.Frequency; + } + } +} \ No newline at end of file diff --git a/aoc2019/lib/IntCodeVM.cs b/aoc2019/lib/IntCodeVM.cs new file mode 100644 index 0000000..2190579 --- /dev/null +++ b/aoc2019/lib/IntCodeVM.cs @@ -0,0 +1,160 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace aoc2019.lib +{ + public class IntCodeVM + { + public enum HaltType + { + Terminate, + Waiting + } + + private readonly long[] program; + private long i; + public Queue input, output; + public long[] memory; + private long relbase; + + public IntCodeVM(string tape) + { + i = 0; + relbase = 0; + program = tape.Split(',').Select(long.Parse).ToArray(); + memory = program; + input = new Queue(); + output = new Queue(); + } + + public long Result => output.Dequeue(); + + public void Reset() + { + i = 0; + relbase = 0; + memory = program; + input.Clear(); + output.Clear(); + } + + public void AddInput(params long[] values) + { + foreach (var v in values) AddInput(v); + } + + public void AddInput(long value) + { + input.Enqueue(value); + } + + private long MemGet(long addr) + { + return addr < memory.Length ? memory[addr] : 0; + } + + private void MemSet(long addr, long value) + { + if (addr < 0) addr = 0; + if (addr >= memory.Length) + Array.Resize(ref memory, (int) addr + 1); + memory[addr] = value; + } + + private long Mode(long idx) + { + var mode = MemGet(i) / 100; + for (var s = 1; s < idx; s++) + mode /= 10; + return mode % 10; + } + + private long Get(long idx) + { + var param = MemGet(i + idx); + switch (Mode(idx)) + { + case 0: return MemGet(param); + case 1: return param; + case 2: return MemGet(relbase + param); + default: throw new Exception("invalid parameter mode"); + } + } + + private void Set(long idx, long val) + { + var param = MemGet(i + idx); + switch (Mode(idx)) + { + case 0: + MemSet(param, val); + break; + case 1: throw new Exception("cannot set in immediate mode"); + case 2: + MemSet(relbase + param, val); + break; + default: throw new Exception("invalid parameter mode"); + } + } + + public HaltType Run(params long[] additionalInput) + { + foreach (var s in additionalInput) AddInput(s); + return Run(); + } + + public HaltType Run() + { + while (i < memory.Length) + { + var op = MemGet(i) % 100; + switch (op) + { + case 1: + Set(3, Get(1) + Get(2)); + i += 4; + break; + case 2: + Set(3, Get(1) * Get(2)); + i += 4; + break; + case 3: + if (!input.Any()) + return HaltType.Waiting; + Set(1, input.Dequeue()); + i += 2; + break; + case 4: + output.Enqueue(Get(1)); + i += 2; + break; + case 5: + i = Get(1) == 0 ? i + 3 : Get(2); + break; + case 6: + i = Get(1) != 0 ? i + 3 : Get(2); + break; + case 7: + Set(3, Get(1) < Get(2) ? 1 : 0); + i += 4; + break; + case 8: + Set(3, Get(1) == Get(2) ? 1 : 0); + i += 4; + break; + case 9: + relbase += Get(1); + i += 2; + break; + case 99: + return HaltType.Terminate; + default: + throw new Exception($"unknown op {op} at {i}"); + } + } + + return HaltType.Terminate; + } + } +} \ No newline at end of file diff --git a/input/day01.in b/input/day01.in deleted file mode 100644 index fb4481d..0000000 --- a/input/day01.in +++ /dev/null @@ -1,100 +0,0 @@ -94735 -80130 -127915 -145427 -89149 -91232 -100629 -97340 -86278 -87034 -147351 -123045 -91885 -85973 -64130 -113244 -58968 -76296 -127931 -98145 -120731 -98289 -110340 -118285 -60112 -57177 -58791 -59012 -66950 -139387 -145378 -86204 -147082 -84956 -134161 -148664 -74278 -96746 -144525 -81214 -70966 -107050 -134179 -138587 -80236 -139871 -104439 -64643 -145453 -94791 -51690 -94189 -148476 -79956 -81760 -149796 -109544 -57533 -142999 -126419 -115434 -57092 -64244 -109663 -94701 -109265 -145851 -95183 -84433 -53818 -106234 -127380 -149774 -59601 -138851 -54488 -100877 -136952 -61538 -67705 -60299 -130769 -113176 -106723 -133280 -111065 -63688 -139307 -122703 -60162 -89567 -63994 -66608 -126376 -136052 -112255 -98525 -134023 -141479 -98200 diff --git a/input/day02.in b/input/day02.in deleted file mode 100644 index c3ac93e..0000000 --- a/input/day02.in +++ /dev/null @@ -1 +0,0 @@ -1,0,0,3,1,1,2,3,1,3,4,3,1,5,0,3,2,10,1,19,1,19,9,23,1,23,13,27,1,10,27,31,2,31,13,35,1,10,35,39,2,9,39,43,2,43,9,47,1,6,47,51,1,10,51,55,2,55,13,59,1,59,10,63,2,63,13,67,2,67,9,71,1,6,71,75,2,75,9,79,1,79,5,83,2,83,13,87,1,9,87,91,1,13,91,95,1,2,95,99,1,99,6,0,99,2,14,0,0 diff --git a/input/day03.in b/input/day03.in deleted file mode 100644 index d8a6b32..0000000 --- a/input/day03.in +++ /dev/null @@ -1,2 +0,0 @@ -R1008,U336,R184,D967,R451,D742,L235,U219,R57,D439,R869,U207,L574,U670,L808,D675,L203,D370,L279,U448,L890,U297,R279,D613,L411,D530,L372,D88,R986,U444,R319,D95,L385,D674,R887,U855,R794,U783,R633,U167,L587,D545,L726,D196,R681,U609,R677,U881,R153,D724,L63,U246,R343,U315,R580,U872,L516,U95,R463,D809,R9,U739,R540,U670,L434,D699,L158,U47,L383,D483,L341,U61,R933,D269,R816,D589,R488,D169,R972,D534,L995,D277,L887,D657,R628,D322,R753,U813,L284,D237,R676,D880,L50,D965,L401,D619,R858,U313,L156,U535,R664,U447,L251,U168,L352,U881,L734,U270,L177,D903,L114,U998,L102,D149,R848,D586,L98,D157,R942,U496,R857,U362,R398,U86,R469,U358,L721,D631,R176,D365,L112,U472,L557,D153,R97,D639,L457,U566,R570,U106,R504,D292,L94,U499,R358,U653,L704,D627,R544,D24,L407,U513,R28,U643,L510,U579,R825,D376,L867,U999,R134,D734,R654,D989,L920,U872,R64,U626,R751,D425,R620,U274,L471,D83,R979,U577,L43,D320,R673,D187,R300,U134,L451,D717,R857,U576,R570,U988,R745,U840,R799,U809,R573,U354,L208,D976,L417,U473,L555,U563,L955,U823,R712,D869,L145,D735,L780,D74,R421,U42,L158,U689,R718,D455,L670,U128,L744,U401,R149,U102,L122,U832,R872,D40,R45,D325,L553,U980,L565,D497,L435,U647,L209,D822,L593,D28,R936,U95,R349,U511,L243,U895,R421,U336,L986,U264,R376,D183,R480,D947,R416,D706,R118,D799,R424,D615,R384,U185,L338,U14,R576,D901,L734,D417,L62,D254,R784,D973,R987,D848,R32,D72,L535,D633,L668,D664,R308,D474,L418,D39,L473,U388,L518,D544,R118,D948,L844,D956,R605,U14,L948,D78,L689,U443,L996,U932,R81,D879,R556,D633,R131 -L993,U227,L414,U228,L304,U53,R695,U765,R162,D264,L530,U870,R771,D395,R27,D200,L235,D834,L559,D128,R284,U912,L959,U358,R433,U404,L539,U799,R271,D734,L104,U261,R812,D15,L474,U887,R606,U366,L694,U156,R385,D667,L329,D434,R745,U776,L319,U756,R208,D457,R705,U999,R284,U98,L657,U214,R639,D937,R675,U444,L891,D587,L914,D4,R294,D896,R534,D584,L887,U878,L807,U202,R505,U234,L284,D5,R667,U261,L127,D482,R777,D223,L707,D468,L606,U345,L509,D967,R437,U995,R28,D376,L2,D959,L814,U702,L38,D154,L79,D439,L259,U143,L376,U700,R894,U165,L300,D58,R631,D47,R684,U935,R262,D857,R797,D599,L705,U792,R439,D444,R398,D887,L81,D40,R671,U332,L820,U252,R691,U412,L794,D661,R810,U157,R858,U566,R892,D543,R10,D725,L653,D812,R733,D804,R816,U862,R994,U221,L33,U271,R766,D591,R575,D970,R152,D693,L916,U404,L658,D847,L605,D433,L583,U587,L129,D103,R407,U780,L901,D676,L846,D687,L9,D47,R295,D597,L808,U134,L186,D676,L62,U305,L73,D369,L468,U30,L472,U280,L413,U961,L98,D966,R308,D178,L21,D789,L871,D671,R665,U927,L906,U633,L135,D894,R110,D205,R324,D665,R143,D450,L978,U385,R442,D853,L518,U542,R211,U857,R119,D872,L246,U380,L874,U463,R153,U982,R832,D784,L652,U545,R71,U386,R427,D827,R986,U870,R959,U232,R509,U675,R196,U389,R944,U149,R152,U571,R527,U495,L441,U511,L899,D996,L707,D455,L358,D423,L14,D427,R144,D703,L243,U157,R876,D538,R26,D577,L385,U622,L149,D852,L225,U475,L811,D520,L226,U523,L338,D79,R565,U766,L609,U496,L189,D446,R63,U396,L629,U312,L841,D639,R466,U808,L60,D589,L146,U114,R165,U96,L809,D704,L61 \ No newline at end of file diff --git a/input/day04.in b/input/day04.in deleted file mode 100644 index 6190bcb..0000000 --- a/input/day04.in +++ /dev/null @@ -1 +0,0 @@ -245318-765747 diff --git a/input/day05.in b/input/day05.in deleted file mode 100644 index 4d8fafe..0000000 --- a/input/day05.in +++ /dev/null @@ -1 +0,0 @@ -3,225,1,225,6,6,1100,1,238,225,104,0,1002,114,46,224,1001,224,-736,224,4,224,1002,223,8,223,1001,224,3,224,1,223,224,223,1,166,195,224,1001,224,-137,224,4,224,102,8,223,223,101,5,224,224,1,223,224,223,1001,169,83,224,1001,224,-90,224,4,224,102,8,223,223,1001,224,2,224,1,224,223,223,101,44,117,224,101,-131,224,224,4,224,1002,223,8,223,101,5,224,224,1,224,223,223,1101,80,17,225,1101,56,51,225,1101,78,89,225,1102,48,16,225,1101,87,78,225,1102,34,33,224,101,-1122,224,224,4,224,1002,223,8,223,101,7,224,224,1,223,224,223,1101,66,53,224,101,-119,224,224,4,224,102,8,223,223,1001,224,5,224,1,223,224,223,1102,51,49,225,1101,7,15,225,2,110,106,224,1001,224,-4539,224,4,224,102,8,223,223,101,3,224,224,1,223,224,223,1102,88,78,225,102,78,101,224,101,-6240,224,224,4,224,1002,223,8,223,101,5,224,224,1,224,223,223,4,223,99,0,0,0,677,0,0,0,0,0,0,0,0,0,0,0,1105,0,99999,1105,227,247,1105,1,99999,1005,227,99999,1005,0,256,1105,1,99999,1106,227,99999,1106,0,265,1105,1,99999,1006,0,99999,1006,227,274,1105,1,99999,1105,1,280,1105,1,99999,1,225,225,225,1101,294,0,0,105,1,0,1105,1,99999,1106,0,300,1105,1,99999,1,225,225,225,1101,314,0,0,106,0,0,1105,1,99999,1107,226,677,224,102,2,223,223,1006,224,329,101,1,223,223,1108,226,677,224,1002,223,2,223,1005,224,344,101,1,223,223,8,226,677,224,102,2,223,223,1006,224,359,1001,223,1,223,1007,226,677,224,1002,223,2,223,1005,224,374,101,1,223,223,1008,677,677,224,1002,223,2,223,1005,224,389,1001,223,1,223,1108,677,226,224,1002,223,2,223,1006,224,404,1001,223,1,223,1007,226,226,224,1002,223,2,223,1005,224,419,1001,223,1,223,1107,677,226,224,1002,223,2,223,1006,224,434,101,1,223,223,108,677,677,224,1002,223,2,223,1005,224,449,1001,223,1,223,1107,677,677,224,102,2,223,223,1005,224,464,1001,223,1,223,108,226,226,224,1002,223,2,223,1006,224,479,1001,223,1,223,1008,226,226,224,102,2,223,223,1005,224,494,101,1,223,223,108,677,226,224,102,2,223,223,1005,224,509,1001,223,1,223,8,677,226,224,1002,223,2,223,1006,224,524,101,1,223,223,7,226,677,224,1002,223,2,223,1006,224,539,101,1,223,223,7,677,226,224,102,2,223,223,1006,224,554,1001,223,1,223,7,226,226,224,1002,223,2,223,1006,224,569,101,1,223,223,107,677,677,224,102,2,223,223,1006,224,584,101,1,223,223,1108,677,677,224,102,2,223,223,1006,224,599,1001,223,1,223,1008,677,226,224,1002,223,2,223,1005,224,614,1001,223,1,223,8,677,677,224,1002,223,2,223,1006,224,629,1001,223,1,223,107,226,677,224,1002,223,2,223,1006,224,644,101,1,223,223,1007,677,677,224,102,2,223,223,1006,224,659,101,1,223,223,107,226,226,224,1002,223,2,223,1006,224,674,1001,223,1,223,4,223,99,226 \ No newline at end of file diff --git a/input/day06.in b/input/day06.in deleted file mode 100644 index 2868a3f..0000000 --- a/input/day06.in +++ /dev/null @@ -1,1110 +0,0 @@ -HL2)HP5 -PD5)SVL -GGS)YTS -59G)C67 -V3R)BTY -B9B)4QH -P42)PNP -3MR)YPD -HPL)T7M -9T9)BV2 -QTG)LZM -LYL)2K1 -ZM2)CCK -983)QLL -WYK)SKS -G2H)5QT -GW2)39Q -K68)HBF -FLF)GYC -Y8H)B69 -H61)TSN -J6L)PZH -BD3)WSD -321)HZ7 -FC4)X58 -7M7)SR7 -KXX)S7P -JBT)HFR -DPQ)96V -47S)36P -JQ8)FJL -1PX)J2L -DR8)HJ5 -1P6)GS4 -LXJ)WDK -8BB)LYL -TPD)9XH -5ZB)TML -ZYQ)DLC -1D2)L82 -SZX)TLH -3HG)2Z4 -T16)DT9 -TDS)8PD -Y9F)VNZ -7NW)LQD -F5W)88Z -YQH)N7L -TRH)V7C -FHB)WDL -DT3)BHQ -4Q8)MXM -J1X)5DP -172)6NG -SR7)FLL -DT9)PZP -M8V)FY6 -RXG)Y4B -H5F)9G9 -B53)F72 -9JQ)2WM -422)BQD -96B)6XD -F89)LCS -F59)9H9 -J73)JQ9 -PNV)BC3 -B84)N4Y -9FC)7L8 -2ZK)79Z -7CM)6R3 -2LL)N46 -DXF)2RH -C6Q)JVW -96V)4FT -G86)3CT -Y4D)33X -MXM)BCN -KRR)S7L -BKX)8FF -RQ7)RLG -6Q5)93D -YCZ)J41 -ZSM)QGQ -R72)2QY -848)SZX -93D)Z9Q -X5S)T2M -1H4)6Q5 -3F1)M8L -Y4W)FLF -K7D)1DD -CGL)8VF -N46)LCX -WDL)XHZ -YZ4)SC1 -6K8)D4Z -Z2B)F5J -SQF)1BV -NK2)BXT -SF7)H5Y -HBF)2GM -7RN)5N6 -9XH)YGR -P7L)HWR -CRR)5JF -GGG)L41 -3JH)HVX -BCH)LNN -4BG)XGX -JCZ)Q5T -SYH)H2H -CLB)TTD -1QW)MX8 -F58)9C6 -DZY)B84 -D76)LX2 -JDC)RKC -55J)B9B -DQY)1RB -41Q)VN9 -TQW)CY7 -G1F)SYH -9MQ)G1F -H1W)3LQ -Y5C)QBJ -CCK)PYL -C6D)P9Y -837)N5C -ZKQ)SPV -DT9)37T -FSQ)GQG -3GY)6BC -TP6)JWB -X42)9Y6 -Z9Q)3G2 -FF9)CFX -WJ8)873 -TPP)VK6 -5ZY)DT3 -1LM)63J -21Z)SQF -RQT)VQT -CSP)H3T -3PC)S6B -337)D7H -HZ7)XRK -36P)8VL -R2C)LTF -NXN)5DQ -S24)5PL -X8H)7D5 -LW1)GYR -H14)9SQ -P15)76B -31W)NX3 -QTH)97M -35S)7XM -DK7)VGQ -VNZ)BGT -T6V)1MB -JK4)H92 -BV1)ZPR -3YG)7WM -YNL)JQ8 -H92)C6G -5GH)R7B -4SK)X7R -KYK)VTJ -DWX)13Z -2QN)XC3 -MPF)CFJ -2DW)G9R -KGF)V15 -BQD)W9L -CX6)LRG -TGZ)KC3 -1S6)YCZ -S7L)3JH -K83)C6Q -H1X)K9L -ZPV)QYC -Z7D)CMZ -PVY)SNN -RVP)5B4 -4SX)5J5 -WK5)C4P -XZ3)8XF -T3J)337 -X5D)DR8 -S6B)9FC -4Z9)1F3 -HF3)VCN -C37)2H4 -71S)NYD -1MB)7CH -TXD)LYX -SF3)P7L -X4Z)VX8 -XRL)RTX -F7V)QMZ -VR9)MHV -F6P)4FB -SC1)N9V -QSH)SG5 -GVP)5DL -C4G)T1T -VH1)RH4 -MZW)4W5 -R7B)MRX -P4F)PY4 -7YW)577 -Y1Y)NGJ -642)M1Z -BLQ)Y4H -3DT)PRB -DPQ)K8G -JKL)N97 -7KZ)ZY4 -CX6)8RN -WM5)W5L -QBM)NK2 -2Z4)X8H -T1T)5BV -2GM)5WD -LZM)V3R -S61)RN6 -744)BD2 -VQT)WBH -QVF)YGJ -P4B)XCQ -J41)3FX -NCP)BL5 -1NK)VPM -9H9)47S -T92)5X8 -W9W)439 -ST9)HTJ -SMD)1NK -DGW)2QN -T7N)LDH -Y9B)3HG -BBW)3DP -QQS)1H3 -YNM)P4F -J4X)KK5 -XHS)FJP -L82)HVP -K9L)2RT -1VG)35S -7GK)RD6 -1QV)BL4 -5NM)Z91 -FK8)DWX -JQ9)7TN -5J5)X7L -5X8)837 -1DD)VYM -PKR)1QV -V32)Y5C -QMZ)XSF -CPY)8KQ -Y23)DQH -P9Y)YBY -DQH)QQS -S98)VB3 -DGF)MS9 -MTR)T5J -PZP)6CK -G6T)3G9 -JYX)ZSM -9G9)J2Q -F2F)NF1 -8X9)JGY -7N3)91G -CJX)PCK -3BR)FP2 -HTQ)JF1 -XW6)XXN -Y47)LZQ -ZZZ)Y23 -VYM)TXW -9G6)27H -Q5T)YLK -BV2)C1N -GZ4)K83 -QXJ)JYX -M8P)YSL -741)VSZ -QXP)BFG -X2H)TJ1 -H2H)G1T -L41)NH6 -QBJ)8BB -XN5)LTC -26R)W2M -2N6)YJD -3LN)XHS -LRG)V65 -4W5)B8Y -HG6)QC9 -Z3L)GFD -MLK)Y1Y -13Z)LCC -4QH)G2H -XSF)M8R -VH7)K7D -V8N)YBV -751)7CM -NW1)P5H -7FK)SHV -R6J)V32 -TK7)H61 -2WM)26R -8RN)5VS -BSF)5ZB -WW5)QXV -N42)2JB -FKG)V4R -Q5T)7GK -XBL)546 -1TC)Z4Y -4F9)ZKZ -XRK)J4X -JZK)XN5 -W23)GZB -V65)TQW -BF7)DXT -726)3F1 -L84)M8P -PDX)9QY -7D4)QSN -439)SCX -WBL)X42 -9NG)P36 -R51)R17 -Z9F)321 -SSS)NSV -DQ4)P15 -R2D)2J4 -LDH)V8N -96V)8J9 -J9C)JDC -YBD)RQ3 -7FK)RSW -YJD)1X7 -LYX)VSR -HWZ)1T5 -W32)B53 -CT7)FPL -YLH)HS7 -C67)2F6 -TGL)1D2 -XH1)751 -B95)TP6 -918)97J -LC7)52P -4W5)Y9F -5DP)XRP -JF1)KXX -95P)8NP -SR8)HG8 -5ZB)D9Q -NRG)F2Z -FMT)J6S -2RC)DGF -4GZ)BXH -4FB)LWM -2YN)69M -PCK)9VS -9W8)L84 -SMH)JHR -B2X)WM5 -96B)BL2 -F7V)R3L -DR3)JBY -ZF8)WRJ -1RB)KTP -TWN)5QY -N7L)WLK -XM8)NRG -T84)6K8 -FY6)XDY -6GC)B9W -HFR)JRG -6BC)SYX -MM1)53N -TDS)KPB -CSD)VJN -XDC)DK7 -6GV)KRR -5JW)15B -VTJ)SMD -MMS)4Z9 -7WM)L7Q -7XM)3PC -QGQ)2GB -WXR)G6T -MTP)65C -5RP)C4G -PP3)Y2M -9SV)27Y -1ZD)2ZK -D2B)7TC -5BV)9MQ -V15)844 -CMZ)1VG -6SH)BKX -C41)366 -3V4)DPQ -8BB)MZW -HXL)X88 -2YN)JKL -YPD)9PN -SPV)YOU -64L)S24 -VGK)ZF1 -ZJN)3WG -CSP)T7N -7CH)MWB -3DP)YNN -37T)3V4 -Z5N)J1Z -578)FPJ -QYC)YNL -52P)FXJ -844)3GY -PWJ)S98 -RB9)M14 -T84)F89 -C58)TCC -YVT)XW6 -P49)STW -ZPR)TPD -Y4W)QFY -BNJ)VGT -3FX)1TC -SP3)FNK -B4Y)PKR -WHY)TDS -VVL)Z5D -C99)GS9 -3WQ)MST -33X)7D4 -BLD)9JQ -MQN)QRP -M8R)ST9 -5DL)1P6 -5QY)D2V -X7R)LSR -BXT)MG4 -6TQ)LVD -XZQ)2KZ -PKW)V3X -QXP)95S -RRY)WLQ -KK5)VH7 -PCG)1RS -SYX)SKW -GS9)ZPV -JBT)62J -N42)PJF -5QT)JYF -QMQ)QRD -W1P)WJY -YD2)51R -XPL)4L3 -RXS)ZF8 -B8B)3ZN -JGY)R51 -9QY)WXJ -SHY)Y9B -HG8)TKR -L7Q)SZG -NYM)9T9 -ZY4)6SF -879)41Q -YBY)LBZ -RNN)J9C -LB6)XQG -48W)XPL -W5K)TYT -JHR)94L -2P8)QBM -ZW3)BF7 -JBD)1GF -X4Z)9NG -HC7)PD5 -7JK)GNY -HQB)31W -M8L)JK4 -LBZ)7NP -FC4)932 -KGF)WW6 -6R3)Z2B -1MM)3F3 -WXR)8BP -SM6)JSD -8WV)6C1 -Z9M)S99 -GZB)MTR -39Q)1VY -VR9)PBP -B6D)MLC -DJW)YTY -X7L)R6J -YNN)G86 -ZPV)NYM -8KQ)5N5 -K1Y)D8G -SVK)M3R -ZZD)XBJ -5VS)M8V -5N5)JZK -D2V)Y8H -SZG)FMS -CG2)2S3 -2H4)9P8 -9XY)SMV -1YJ)3DT -932)NDV -3PK)PKW -8PD)T4Z -6C1)578 -6NK)2LL -NF1)H4Z -KC3)YQ2 -1F3)B9V -XLH)H1W -1RS)YQH -R3L)92R -COM)K9X -TTD)BNJ -4SV)5HZ -549)J2W -S96)4JG -88Z)TK7 -7D4)JPH -PYG)F76 -TSC)W23 -9Y6)48W -S7P)QMQ -15Y)NGF -82B)NL3 -2RH)BW5 -B8Y)MM1 -L6M)JRV -53V)S61 -K8G)7YW -N5S)VQ8 -W2H)WK7 -GS7)3ZK -WSD)965 -J2W)7FK -PNS)S6T -XHS)9LF -1Z3)WJ4 -7F3)8X9 -XRP)1KP -QGR)QNM -5CB)N5N -T21)F2F -FP2)XZ9 -7L8)BCH -B9W)KCL -XNB)JFV -H4Z)2V1 -C1N)DXF -LTF)918 -KMJ)WSW -CYN)Y7D -KG3)XNB -SGC)TXD -KPB)Q9J -Y4B)KNW -MBC)XY7 -XY1)717 -VTH)RXS -VK6)S96 -HP5)T6H -BMC)15Y -X6L)D2B -S99)P6L -642)HWZ -Q9J)V3G -QM5)457 -72F)TWN -YTS)K9N -VQ8)QXP -XN5)WMB -Z6B)1Z3 -JFV)HZB -NH6)4BY -8VF)RQT -1F3)BP7 -1LQ)WF3 -RTX)SVK -RV4)572 -61D)64D -SQY)XHJ -TFB)KMX -GD7)RRY -TJ1)FC4 -J5K)PYG -WLK)DGW -PYL)F58 -PY4)X61 -K5P)W32 -SMD)GSG -SY2)XLH -43L)XX5 -4DJ)NVS -GF5)T8J -R6J)T16 -6NG)W1R -LCS)6WZ -N9V)JBN -H9N)86Z -NS9)3MR -C2R)DLH -NM3)9H4 -YSL)CQC -N8X)GZ4 -XVG)Z9F -FPL)LXJ -PZH)ZJN -B9V)W2H -XDC)PNS -873)V82 -Q6L)S21 -P4R)642 -YQ2)QMR -C66)JJ2 -CFJ)FFQ -NDV)MDT -D44)5ZY -HND)B8B -P67)PCG -QC9)C58 -6Z5)3PK -N5N)CPY -6NG)N8P -6ND)LC7 -2RT)GBM -GWW)WJB -5DQ)3WS -5WD)1MM -SQY)1LM -STW)2HX -R2T)1S1 -8BP)XMG -VPM)PVP -HWR)858 -N8P)ZDH -3G2)4KC -T8J)5HL -VLG)WBL -ZKZ)QM5 -4L3)5PN -G9R)WYK -SH1)K2B -JRG)9MN -WBH)B7R -4FT)Y72 -LCX)VL5 -1H4)1XQ -DLH)848 -V3X)7F3 -CT7)SF7 -M6J)Q7R -5B4)YLH -SNN)XZQ -5GH)DV3 -GS7)JCZ -D9Q)CJX -MX8)172 -MG4)J73 -RQ3)9G6 -FJP)SC6 -SKW)NDP -1YN)T21 -1H3)GW2 -YBD)6PV -62J)MLK -BFG)GGS -GYR)P49 -6TQ)8Z3 -JSD)87S -V82)53V -HTQ)YNM -CJM)FHB -JBD)SQY -XY7)MPF -RN6)Q4W -VN9)2MT -3VM)61H -RN2)QGR -BV6)BLQ -3WG)XPY -B69)TGL -3VT)HG6 -BL2)M1P -1BV)2DW -75P)3WQ -9PN)CG2 -DGF)J78 -LQD)5GH -L2H)96B -XX5)82W -GYC)SGC -LYL)S9Z -HZB)D8R -K9N)6SH -6R3)S3N -NGJ)VB5 -QLL)SH1 -366)6Z5 -QRP)9XY -NL3)21Z -2G7)MJZ -P6L)RN2 -DSH)GBJ -VGQ)95P -N97)94D -BD2)X47 -T6H)VMN -G1R)B6D -B7R)R72 -K9X)1PX -NJ8)2RC -S9Z)ZM2 -HW5)FMT -FPJ)M5C -MST)1P9 -965)X32 -NX3)CGK -717)DR3 -1D2)TSC -RXH)H9N -8G2)HPL -D8G)XXT -5QT)4SX -1XS)NHG -M9V)PF2 -4FB)744 -8NP)5JW -LZM)H14 -J9C)484 -7TC)Z4B -Z27)1LQ -RKC)GVP -RQC)JBD -LVD)FKJ -GFD)HQB -8J9)1ZD -6SF)SAN -SC8)BK9 -VGT)JX7 -KCZ)4HT -K9L)MQN -9MY)LZ5 -JLP)WVP -HFV)Z7D -J1Z)LB6 -X61)T92 -WW6)VTH -KNC)NL4 -C4P)RSJ -QNM)TFB -N12)983 -3JJ)QR5 -LZ5)H84 -KTP)7JK -3WB)Q6L -MS9)YW7 -DXT)Y4W -3G9)LVC -2K1)1YJ -577)ZQT -7NP)Y47 -PVP)ZW3 -V3H)SSS -ZVM)ZZZ -1GF)ZYQ -HVX)R2D -J9G)4GZ -3FX)CX6 -97J)X4Z -WMB)M2K -9LF)B95 -QBJ)HF3 -JWB)292 -QRD)P42 -Q4W)RV4 -XPY)M5Y -5DQ)JGR -95S)GYM -T7M)SY2 -6GV)PNV -P5H)7YV -6XD)FVC -ZRP)LWH -BP7)W78 -6G4)741 -G2B)HTQ -F2Z)D6P -XZ9)XVG -T7M)1H4 -1X7)55J -94D)9ZH -HJ5)R2C -WSW)3VT -2JB)CLB -91G)GGG -S21)NJ8 -1Z3)5RP -15B)WXR -Q63)PMD -18C)C2R -97M)DQ4 -MRX)Y4D -82W)BBW -QR5)2P8 -CYN)H5F -WRJ)PWK -XCQ)3V1 -BFM)8LX -69M)HGF -LCC)9W8 -15Y)71S -WLF)CRR -MDT)549 -918)19W -J9B)82B -H6R)HL2 -2S3)1XS -5JW)6ND -WF3)NCP -XGX)5CH -6WZ)SHY -J67)P4B -VSR)J6N -9ZH)35Y -MRJ)DSH -86Z)X2H -TXW)WJ8 -3LQ)N8X -9H4)3LN -KK5)4SK -NHG)K4C -GYM)43L -XQ4)KDX -Z5D)DZY -H4Z)JBT -BK9)KYK -1KP)BV6 -44Y)T6V -T1T)TRH -95Q)XZ3 -47X)375 -PRB)MJX -VL5)FR1 -CGK)7RN -5CH)9BB -5WN)NVY -SKS)YVT -DV3)SM6 -63J)ZRP -7YV)GY7 -PKW)T3J -JRV)XQ4 -2WM)XWK -F5J)GF5 -5PL)5WN -LWH)J67 -WJY)N39 -N12)3WB -FLL)RB9 -T5J)J9B -FFQ)YD2 -R2D)SC8 -VX8)6G4 -VMN)PP3 -NDP)V3H -V8N)2XQ -8VL)GD7 -1S1)4F9 -GHT)8G2 -T8V)4T3 -DLC)MBC -1RS)VH1 -VN9)SMH -N39)RNN -W78)SCY -3F3)Z17 -8LX)ZQY -3VT)B11 -9BB)SP3 -D8R)NW1 -NGF)ZL8 -NVS)G2B -ZQY)4FY -BHQ)C99 -2KZ)HFV -D6P)NM3 -YTY)4DJ -6PV)61D -TK7)1WL -1VG)F7V -5JF)75P -XWK)LZZ -V7C)NXN -RSJ)XY1 -BCN)K5P -TCC)3YG -V4R)RHF -1P9)NHK -JJ2)CW6 -SCY)CYN -Z17)ZZD -VMQ)BV1 -XMG)44Y -H84)726 -R72)KMJ -546)WK5 -T4Z)QSH -CFX)WLF -JGR)TGZ -V7C)HXL -PBP)RB5 -KMX)7M7 -N65)MMS -XXN)9SV -VLN)422 -RTX)8MY -J6S)TTH -YGJ)4SV -FN9)59G -NYD)H5N -YW7)8WV -GNY)7NW -TYT)YZ4 -BL2)64L -HS7)P4R -XHJ)XDC -N5C)HND -CW6)W9W -8FF)3YH -HD3)Z6B -2J4)J9G -7G7)KM7 -S6T)BLD -WDK)Q63 -PJF)PH3 -ZGX)DJW -JBY)HCG -SMV)M9V -3ZN)B2X -RB5)VMQ -XXT)YBD -35Y)5BH -ZF1)LW1 -LTC)D44 -SHV)C41 -WJB)HD3 -MHV)VLG -W5L)FSQ -FVC)QTH -QR5)FLP -8MY)C6D -KDX)J6L -ZQT)95Q -SH1)WHY -BL4)JLP -VB3)RQ7 -GY7)ZGX -RH4)XNZ -D4Z)VFR -ZZZ)PDX -NM3)QTG -6CK)XRL -92R)XH1 -LBZ)SR8 -JNM)BTB -Q7R)FK8 -M2K)JV2 -457)1S6 -Q6L)B4Y -BC3)2G7 -VJN)6NK -B9W)CGL -WVP)BSF -HVP)VGK -9MN)879 -YLK)QVF -J2Q)QXJ -MLC)47X -NHK)DQY -9G9)18C -2X2)Z9M -375)QGC -572)F59 -YJD)RQC -X47)BFM -M14)N5S -S3N)6GC -4T3)C66 -4DJ)X5D -P36)W5K -H5Y)SF3 -WXJ)CT7 -BL5)ZVM -JTW)6GV -M1Z)17T -27Y)ZKQ -1XQ)TTF -LZQ)DPY -Z9F)J1X -NL4)X6L -LCC)HMV -RD6)KCZ -M1P)H6R -TKR)3VM -1WL)CSD -KCL)RVP -QGC)HC9 -V3G)Z5N -NSV)9MY -VFR)G1R -M5Y)VR9 -S9Z)KNC -YQH)N12 -K4C)T84 -4JG)T8V -SG5)JNM -79Z)V5L -PWK)MRJ -95Q)J5K -FXJ)FN9 -7D5)KGF -K2B)VD1 -QSN)4Q8 -PD7)SLF -BKX)WW5 -YGR)PWJ -LWM)XBL -XDY)3JJ -9VS)D76 -3WS)4BG -B11)F6P -94L)N42 -VTH)PD7 -9H9)N65 -YNL)2N6 -JV2)CJM -M5C)7G7 -RH4)W1P -64D)BD3 -FKJ)R2T -Z91)RXH -FJL)RXG -Y2M)DM4 -2F6)L6M -27Q)KG3 -9SQ)M6J -KMJ)Z27 -3ZK)CDV -3YH)1YN -SCX)NS9 -C6G)27Q -GQG)5CB -C6L)5C1 -MJZ)NP1 -BGT)C37 -NXN)P67 -ZL8)FKG -36P)JTW -LSR)X5S -2XQ)H1X -X58)L2H -G1T)HC7 -FLF)Z3L -XX5)7KZ -SLF)VVL -ZDH)TTQ -WK7)F5W -8XF)K1Y -87S)3BR -W2M)GHT -PF2)2YN -17T)HW5 -TSN)2X2 -Z4Y)BWY -J2L)PVY -76B)K68 -H5F)XM8 -TTQ)GWW -61H)MTP -JYF)C6L -MBC)BMC -PMD)TPP -MJX)CSP -LZ5)1QW -XBJ)FF9 -T2M)6TQ -53N)GS7 -2QY)VLN -RLG)72F -HC9)5NM -YBV)7N3 \ No newline at end of file diff --git a/input/day07.in b/input/day07.in deleted file mode 100644 index 0128ef0..0000000 --- a/input/day07.in +++ /dev/null @@ -1 +0,0 @@ -3,8,1001,8,10,8,105,1,0,0,21,46,59,84,93,110,191,272,353,434,99999,3,9,101,2,9,9,102,3,9,9,1001,9,5,9,102,4,9,9,1001,9,4,9,4,9,99,3,9,101,3,9,9,102,5,9,9,4,9,99,3,9,1001,9,4,9,1002,9,2,9,101,2,9,9,102,2,9,9,1001,9,3,9,4,9,99,3,9,1002,9,2,9,4,9,99,3,9,102,2,9,9,1001,9,5,9,1002,9,3,9,4,9,99,3,9,102,2,9,9,4,9,3,9,102,2,9,9,4,9,3,9,102,2,9,9,4,9,3,9,102,2,9,9,4,9,3,9,101,1,9,9,4,9,3,9,102,2,9,9,4,9,3,9,101,2,9,9,4,9,3,9,101,2,9,9,4,9,3,9,1001,9,1,9,4,9,3,9,101,2,9,9,4,9,99,3,9,102,2,9,9,4,9,3,9,1002,9,2,9,4,9,3,9,1002,9,2,9,4,9,3,9,1001,9,1,9,4,9,3,9,1001,9,2,9,4,9,3,9,101,1,9,9,4,9,3,9,1001,9,2,9,4,9,3,9,1002,9,2,9,4,9,3,9,1001,9,1,9,4,9,3,9,1001,9,2,9,4,9,99,3,9,101,1,9,9,4,9,3,9,1001,9,1,9,4,9,3,9,101,1,9,9,4,9,3,9,101,1,9,9,4,9,3,9,1002,9,2,9,4,9,3,9,1002,9,2,9,4,9,3,9,1002,9,2,9,4,9,3,9,1001,9,1,9,4,9,3,9,102,2,9,9,4,9,3,9,101,1,9,9,4,9,99,3,9,1001,9,1,9,4,9,3,9,102,2,9,9,4,9,3,9,101,1,9,9,4,9,3,9,1002,9,2,9,4,9,3,9,1001,9,2,9,4,9,3,9,101,1,9,9,4,9,3,9,1002,9,2,9,4,9,3,9,1002,9,2,9,4,9,3,9,1001,9,1,9,4,9,3,9,102,2,9,9,4,9,99,3,9,102,2,9,9,4,9,3,9,1002,9,2,9,4,9,3,9,1002,9,2,9,4,9,3,9,1001,9,1,9,4,9,3,9,101,1,9,9,4,9,3,9,102,2,9,9,4,9,3,9,1002,9,2,9,4,9,3,9,101,2,9,9,4,9,3,9,1002,9,2,9,4,9,3,9,1001,9,2,9,4,9,99 \ No newline at end of file diff --git a/input/day08.in b/input/day08.in deleted file mode 100644 index 9100e5b..0000000 --- a/input/day08.in +++ /dev/null @@ -1 +0,0 @@ -112222222222222212222122220212222222202222222222222122222222202100222222120222101222222122222222221222220102222222222020222222212221222222222222221222102222222222222212222222220222222222202222222222222122222222222100222222120222121222222122222222221222221002222222222222222222202221222222222222222222022222222222222212222222220222222222202222222222222222222222222201222222120222010222222022222222221222220012222222222021222222212222222222222222221222112222222222222222222022222212222222222222222222222022222222202000222222021222021222222222222222221222220202222222222222222222202221222222222222222222212222222222222202222222222222222222222222222222222222222222212021222222021222001222222222222222222222222122222222222222222222222221222222222222221222222222222222222202222122222222222222202222212222222122222202212110222222222222220222222022222222220222221012222222222020222222222221222222222222220222022222222222222202222222221222222222222222212222202122222202202012222222222222220222222122222222222222222122222222222220222222222222222222222212220222112222222222222222222122221212222222222222202222212222222222222111222222121222121222222122222222220222222100222222222221222222212221222222222222221222022222222222222212222022222212222222212222202222222222222212122011222222222222002222222122222222222222220012222222222021222222222220222222222222220222022222222222220212222022222202222222202222212222201122222202222212222222222222102222222222222222222222222212222222222222222222212220222222222202221222002222222222222222222022220212222222212222212222220122222212022201222222121222100222222122222222220222222122222222222122222222202222222222222212222222002222222222222222222122222212222222222222222222222222222222102110222222221222101222222222222222220222221212222222222021222222202222222222222222221222202220222222220212222222222222222222212222202222211022222202022221222222222222001222222122222222021222220012222222222122222222212221222222222222222222212222222222221202222022221222222222222222212222200222222212012101222222021222200222222022222222120222222210222222222021222222212222222222222222220222002222222222221212222222220212222222202222222222212222222222202202222222221222100222222022222222220222222000222222222121222222212220222222222212221222112220222222221222222222222222222222212222212222222122222212122212212222221222010222222022222222022222222002222222222120222222202222222222222202222222222222222222221222222022221222222222212222202222212122222222122201212222120222101222222222222222222222221212222222222120222222222220222222222202220222022221222222222212222122220222222222212222212222212022222202222012222222120222000222222222222222121222222221222022222220222222222222222222222202221222002221222222222222222122222212222222202222012222211222222212112111212222122222020222222022222222022222221011222122222220222222212221222220222211221222112222222222221222222122221222222222222222102222211222222212002101202222020222111222222222022222122222222022222222222122222222222222222220222220222222202222222222220222222122221212222222202222222222222022222222202200222221021222220222221222122222122222221011222022222222222222202220222220222201222222112222222222221202222122222222222222222222012222210122222212012000202222121222011222221022220222020222220002222122222222222222222220222222222202020222002220222222222222222122221022222222202222222222220122222212102201222221022222221222221022022222222222220100202222222220222222202220222221202201221222022221222222220222222022220002222222202222202222210222222202022101202222220222120222221220021222021222221000212122222220222222212222222220222211122222002222222222220202222222221212222222222222102222221222222212002001202222021222011222220021121222222222220201212122222021222222212220222222222221220220022220222222221212222122222222222222222222102222222022222202112000222021022222011222222121220222121222220101222022222122222222212221222222212212122222022220222222121222222222220202222222222222012222210222222212222120222220221222222222221121121222220222220022212222222222222222222220222220202220020222202221212222020222222222221022222222212222112222202022222212212021202222021222202222220122221222120222220020112122222022222222200222222222222210120222022222202222021212222022222002202222222222222222221122222202112201212221020222200220221020120222022222220012212022222120222222212222222222212211122222012222212222020222222122221002212222212222102222222222222210002010212221221222211222221220121222222222220211102122222022222222220221222221222220122221222221212222022202222122222122222222202222012222211022222202222110222121122222112221221222222222121222220202122022222022222222220220222222212200020221202220222222221202222222220202222222222222022222211122222222222120212022221222120222222221120222122222222100222022222021222222201222222220222220220222022222212222120211222122220222212222202222222222202222222212212221202221221222021221220021220222022222222002112122222021222222211220222221222200122222212021202222122200222122220022202222202222222222211222222200122122212122220222112221220122122222120222222222102022222122202222220221222221202202220222102222212222022200222112220222212222212222212222220022222212012020202121120222212221222020220222120222221101122222222022212222210220222221202211222220022021202222222220222120222222202222202222012222210222222210212021212021120222102220222222220222120222221000122122222220202222222020222222212222021222112022212222221202222021222102220222212222022222221022222222202102212021121222101222222120021222122222222212122122222021202222210022222222222212220222112021202222122201222101222212202222202222102222211022222210012010212120222222121221222121021222022222222002112022222222212202200222222222222210222220012121212222120202222012221102212222201222212222212122222220122101212221222222212222222020222222122222221122212022222121212222211221222222222220120222222220222222120221222200221112211222212222112222211122222220222010222121220222211220220120021222022222220021222222222020212212210221222221202222122222012220202222221211222212220202211222201222112222212122222202112222222121122222220222222120120222021222222001212122222021212212200121222221212200022222222020202222020222222100220112221222200222022222221222222200012010212221120222200222222220121222221222222211022222222222202222221122222221212210221220222120212222121200222100220202211222200222022122212122222222122100212121120122212221221021122222020222222102202222222022202222210121222220212200220222122221222222222200222110222012201222222222002022211122222211222001222021022122101220220221120222021222222200112122222020212212210020222220222212122221222220202222020212222010221122202222220222022222220022222221122221212120021122222221222220020222021222220010012222222022202212221121222220222201122220212221212222020211122202220112200222201222112022201222222202102022212021020122021222220222221222021222221000102022222120212222220021222221222222121220102022202222020202222000220002211222221222002022220022222201022112222122121222102220221120121222120222221201212122222222212202220022222222221200022222222222222222022212122211221112222222222222012022222222222220122120212122021022202220222220220222122222222210212122222122212222212021222200220201021222202120222222022221222212220222210222212222202122211222222212002001202022222022200220220222120222021222221222002122222122212222221221222221201211221221012220222221220200122212212102210222210222212122221122222212122101212122022022211221221122122222222222222200012102222020212212221221222202210211221221022021202220022220222101202222211222221222002122211222222202122100212221122022001220222122221222121222221020212002222122222212202222222201222210221220001221212221022221222201211222211222202222122222211222222222122202212121121122010220221222121222021222220201012212222220212212211220222211212202220222221022202222220220122101202022221222221222122222201022222200002202212220021222000222222021220222102222222202202102222120222212211222222201211210021222211120222221021221122120220222220222210222012222201022222221202121222020122122201220021120221222211222220122212122222220212222201221222210200211220222111020212221222211122000220002210222212222202002201222222201222202222222020222011221021120222222211222221120002222222022202222210222222201210201122220001222222221020202122020202022212222201202002012202222222200002101212122121222012220022022120222120222220110102002222122212202211022222220210200220221222121222222220212122020212112220222221212102102212022222210212221202122221022021220021021221222010222222011102222222221202212212020222222202201221221211222202221020201022120202102201222210212202222212122222201222011212121222122201222120220220222121222221210002112222220222202222022222211212221121222101121222222120200222202201012222222201212002012210222222221002111202021221122000222220020121222020222220122202022222020222212211121122211222222220222020220202221120221222111212022221222201212112122222022222221022100222122122122222222122022220222222222220002202212222222212202221222022210221222022220212121222222022222122201222122212222202202212202221122222211102112202222020022002222121221022022200220221020011202222121212212200121122200210202222222111220222220222200022112212002211222200222122202211022222212120211222221220022020220022221021222011222221120011002222021212212222222222210220221121221020222212221022220122000202102201222221212002122212122222001012121202122222022001222220022121022201222020200212112222020202222210021122212212210221222000221222221222202022122200222200222221222222212220222222200000012212120021122210222020120221222202221021000022102222220212112201122022222202201022222211222212222221222122221212112222222220212112212212022222112212011222122220122120222221220022022110221020111000112222120202222202021022221202200022220000220222220222221122122222002222222212212022112221122222201112210212220122222212222020222112222022221122122010222222120222012220121122211212200122220212222202220020202022210212022210222201222222122222022222011002011202120222122211221221222211102101221121202220102222122212212221222122210200202220221010122210220020201022020212122202222212202222212222222222001022201212022020222102220021122201221011221222212010002222220202002200021222201210221121220110221210221020211222012202102201222200212102212222122222212221001202021022122211222020122111221110220021212222012222221212212210020222212201200122221200222211222120212122122201222210222202222222002202222222222001222222121221022020222221022121021110220122211000122222121222011211022222221221111020222011120220220020221022020222212212222222212002212200022222221002221212220021022021222220022222000200222020100202002222200212002200220022220202201220222222021222220221210122101222102220222202212212102201122222002020012222022222202012221221222122121120221021112221212212001222000211220022222212002121220010121212220220201222020220012212222210222102022221022222221101021212021021122122222121222222101101222120110110112212010102111220222222202212011020222212222111222221210122020221212220222211202110022221222222102011120212120020102120221222222111121220222120011112002202010122212222220222201200112021200112121120220020201022110200002202222211222200022220122222200220111212021122012012221221222000211012221021201122212222022022012212022022200202012222212201022210221220211022102210112212222220222200012201222222011120101212022121022002220122121212122002221122101110202212110112012210122022201212210112212110121221222021212022200201102200222211202200022220222222000210201202020021010002222020021201101220220122201220202222102102021212120122211201001112212020122110221022220122122220012212222211202200212212022222022202222222121221202122221220222011000012222221212020212202222212202200221022201221111000200000220002220200210122221222012202222211212000202222222222021201101202122122020222220120221112200121210020210101122212201012021210221122200211102212200012020200220220222022111212202211222222222222212202122222111202022222222121021111220220120001220120222021211200002222000022000202221222210210220101220102021110220112200221122210212212222220222012112220122222112020110222220121121211202020022111000100211022112020212212121102022212222122202222220201212002022012222002202020010222212212202202202222212212022222010210101202122020002101222022122202022121222120220100102212120012020220020222201201000211211120120112222202212222021021112220202202202120022212022222021111220202222022222121201022120201010212211122121202002212121222222222022022202221021010201111201200220112201122220010222210222202222102012222222222112020002222020121220221221021221211212021202121021100022212020212210212122122201220120000211202201121222101222220202122002210222210202221222202222222221210001212022120221222211020022022001002220220222000012202021002020200222022210221011220200101202012220220202221201020122220222222202202112220222222102121221212122021100121210020122112201210220021120012002202101002002220220222212201022100221122220011210011222021020201022211222200212121112200022022002210100212222022122000200021120110212011200220001020202212022122122202220222211002022220200122020122200001212021200110202212222212212001212222022222000200101222010221210201211021022111100001221120221201212212222202211220121022221001121111221222212011200110202120121001202200212222202212202212122022100010012222211121110001202022222120022020221222002202002222011102212200220022210111202010210122212200211000102021001010202220222202202100222220122022100112200212211122012202011020220102021210202020221000222202020212201210022122202012211212211010011200211002020122110021022202202222222211112211222222000102010222222221112210211122122022112122222020001002212222101102221201021222210201010220221011022102202110221221022010222222222221212022102221222022120111002202210022121121100221121221000120212022212121112212220112010212222222211020222010202112201010212110001220102211222220222210202210112221122212201222200212112221120220212020221201100210210120111020112212100112201211020122222020211220200002101012201211122221022201012201202212222102112221022102021100112212201021102002011222120220200200202022110012122202000212202220221122211020011012210022000121200121200122202011212220212212212222222202022022000220022212102221100111101221120002111210000122201220212202100002202202022022201110201021222110120202222000012021211021122212221220202201022201122122001201022212210220121002000020121212020022021221222111012202210102211201121022210002120001220212020012210020222021120121222220221201222102002202222022000201001222122220222210010222022102200120202220002201102212001112012210200022220101122102202111121121210100220221020012212200210212202111212201022012201010020202201020202110002122220211200202212021001110022202001022022220201122212012010111210101002020222011112222111210122200220012220220002210222222001012120222112121012001112021121202212121112121012112112212210002010210222222202111200210211202121012002102000101211111010100120221012202200121110120121110120020121100021222100011001001200112000212100001000010102120220120002000122100001220102 diff --git a/input/day09.in b/input/day09.in deleted file mode 100644 index 0e05ddc..0000000 --- a/input/day09.in +++ /dev/null @@ -1 +0,0 @@ -1102,34463338,34463338,63,1007,63,34463338,63,1005,63,53,1101,0,3,1000,109,988,209,12,9,1000,209,6,209,3,203,0,1008,1000,1,63,1005,63,65,1008,1000,2,63,1005,63,904,1008,1000,0,63,1005,63,58,4,25,104,0,99,4,0,104,0,99,4,17,104,0,99,0,0,1101,0,252,1023,1101,0,0,1020,1102,1,39,1013,1102,1,234,1029,1102,26,1,1016,1101,37,0,1005,1101,0,27,1011,1101,21,0,1000,1101,0,29,1019,1101,35,0,1003,1102,22,1,1007,1102,1,32,1001,1101,1,0,1021,1102,1,216,1027,1102,30,1,1012,1102,1,24,1009,1101,36,0,1002,1101,0,31,1010,1101,0,243,1028,1102,787,1,1024,1102,255,1,1022,1102,33,1,1017,1102,1,23,1004,1102,778,1,1025,1102,1,28,1008,1101,0,223,1026,1102,1,25,1015,1101,0,20,1006,1102,34,1,1014,1101,38,0,1018,109,-4,1202,5,1,63,1008,63,32,63,1005,63,203,4,187,1106,0,207,1001,64,1,64,1002,64,2,64,109,37,2106,0,-6,1001,64,1,64,1106,0,225,4,213,1002,64,2,64,109,3,2106,0,-8,4,231,1001,64,1,64,1105,1,243,1002,64,2,64,109,-12,2105,1,-1,1105,1,261,4,249,1001,64,1,64,1002,64,2,64,109,-13,2102,1,-3,63,1008,63,31,63,1005,63,285,1001,64,1,64,1106,0,287,4,267,1002,64,2,64,109,6,21102,40,1,0,1008,1017,40,63,1005,63,313,4,293,1001,64,1,64,1105,1,313,1002,64,2,64,109,-10,2107,31,-6,63,1005,63,331,4,319,1105,1,335,1001,64,1,64,1002,64,2,64,109,-6,2102,1,7,63,1008,63,28,63,1005,63,357,4,341,1105,1,361,1001,64,1,64,1002,64,2,64,109,2,21107,41,40,8,1005,1011,377,1106,0,383,4,367,1001,64,1,64,1002,64,2,64,109,-1,1201,2,0,63,1008,63,26,63,1005,63,403,1106,0,409,4,389,1001,64,1,64,1002,64,2,64,109,22,1205,-4,425,1001,64,1,64,1105,1,427,4,415,1002,64,2,64,109,-9,21101,42,0,3,1008,1018,39,63,1005,63,451,1001,64,1,64,1105,1,453,4,433,1002,64,2,64,109,3,21107,43,44,0,1005,1018,475,4,459,1001,64,1,64,1105,1,475,1002,64,2,64,109,-7,21101,44,0,0,1008,1011,44,63,1005,63,497,4,481,1105,1,501,1001,64,1,64,1002,64,2,64,109,17,1206,-7,513,1105,1,519,4,507,1001,64,1,64,1002,64,2,64,109,-24,1207,5,25,63,1005,63,537,4,525,1105,1,541,1001,64,1,64,1002,64,2,64,109,7,21108,45,43,2,1005,1013,557,1106,0,563,4,547,1001,64,1,64,1002,64,2,64,109,-5,1207,-3,34,63,1005,63,583,1001,64,1,64,1106,0,585,4,569,1002,64,2,64,109,5,21108,46,46,5,1005,1016,607,4,591,1001,64,1,64,1105,1,607,1002,64,2,64,109,-12,2108,20,8,63,1005,63,627,1001,64,1,64,1105,1,629,4,613,1002,64,2,64,109,24,1206,-3,647,4,635,1001,64,1,64,1105,1,647,1002,64,2,64,109,-30,2108,32,8,63,1005,63,665,4,653,1106,0,669,1001,64,1,64,1002,64,2,64,109,22,1208,-9,20,63,1005,63,691,4,675,1001,64,1,64,1106,0,691,1002,64,2,64,109,-4,21102,47,1,3,1008,1014,49,63,1005,63,715,1001,64,1,64,1105,1,717,4,697,1002,64,2,64,109,-10,2101,0,1,63,1008,63,36,63,1005,63,743,4,723,1001,64,1,64,1105,1,743,1002,64,2,64,109,16,1201,-9,0,63,1008,63,28,63,1005,63,769,4,749,1001,64,1,64,1105,1,769,1002,64,2,64,109,2,2105,1,5,4,775,1001,64,1,64,1106,0,787,1002,64,2,64,109,-5,1202,-6,1,63,1008,63,26,63,1005,63,807,1106,0,813,4,793,1001,64,1,64,1002,64,2,64,109,-16,2107,37,4,63,1005,63,833,1001,64,1,64,1105,1,835,4,819,1002,64,2,64,109,2,2101,0,1,63,1008,63,34,63,1005,63,855,1105,1,861,4,841,1001,64,1,64,1002,64,2,64,109,19,1205,2,875,4,867,1105,1,879,1001,64,1,64,1002,64,2,64,109,-2,1208,-8,23,63,1005,63,899,1001,64,1,64,1106,0,901,4,885,4,64,99,21101,0,27,1,21102,915,1,0,1106,0,922,21201,1,61455,1,204,1,99,109,3,1207,-2,3,63,1005,63,964,21201,-2,-1,1,21102,942,1,0,1105,1,922,22102,1,1,-1,21201,-2,-3,1,21102,1,957,0,1105,1,922,22201,1,-1,-2,1106,0,968,22101,0,-2,-2,109,-3,2105,1,0 \ No newline at end of file diff --git a/input/day10.in b/input/day10.in deleted file mode 100644 index bf4ecf6..0000000 --- a/input/day10.in +++ /dev/null @@ -1,24 +0,0 @@ -##.##..#.####...#.#.#### -##.###..##.#######..##.. -..######.###.#.##.###### -.#######.####.##.#.###.# -..#...##.#.....#####..## -#..###.#...#..###.#..#.. -###..#.##.####.#..##..## -.##.##....###.#..#....#. -########..#####..####### -##..#..##.#..##.#.#.#..# -##.#.##.######.#####.... -###.##...#.##...#.###### -###...##.####..##..##### -##.#...#.#.....######.## -.#...####..####.##...##. -#.#########..###..#.#### -#.##..###.#.######.##### -##..##.##...####.#...##. -###...###.##.####.#.##.. -####.#.....###..#.####.# -##.####..##.#.##..##.#.# -#####..#...####..##..#.# -.##.##.##...###.##...### -..###.########.#.###..#. \ No newline at end of file diff --git a/input/day11.in b/input/day11.in deleted file mode 100644 index 693f432..0000000 --- a/input/day11.in +++ /dev/null @@ -1 +0,0 @@ -3,8,1005,8,350,1106,0,11,0,0,0,104,1,104,0,3,8,1002,8,-1,10,101,1,10,10,4,10,1008,8,1,10,4,10,102,1,8,29,1006,0,82,1006,0,40,3,8,1002,8,-1,10,101,1,10,10,4,10,1008,8,0,10,4,10,1002,8,1,57,1,102,15,10,1,1005,14,10,1006,0,33,3,8,102,-1,8,10,101,1,10,10,4,10,1008,8,0,10,4,10,102,1,8,90,1,1008,14,10,2,3,19,10,1006,0,35,1006,0,21,3,8,102,-1,8,10,1001,10,1,10,4,10,108,1,8,10,4,10,1002,8,1,125,1,1105,11,10,2,1105,9,10,1,4,1,10,2,1,4,10,3,8,1002,8,-1,10,101,1,10,10,4,10,1008,8,0,10,4,10,101,0,8,164,1006,0,71,3,8,102,-1,8,10,101,1,10,10,4,10,1008,8,0,10,4,10,1002,8,1,189,1006,0,2,1,5,17,10,1006,0,76,1,1002,7,10,3,8,1002,8,-1,10,101,1,10,10,4,10,108,1,8,10,4,10,1001,8,0,224,1,3,5,10,3,8,1002,8,-1,10,101,1,10,10,4,10,108,1,8,10,4,10,101,0,8,250,1,1,20,10,1,102,13,10,2,101,18,10,3,8,1002,8,-1,10,101,1,10,10,4,10,108,0,8,10,4,10,102,1,8,284,2,105,0,10,1,105,20,10,3,8,1002,8,-1,10,101,1,10,10,4,10,1008,8,1,10,4,10,1002,8,1,315,1006,0,88,1,2,4,10,2,8,17,10,2,6,2,10,101,1,9,9,1007,9,1056,10,1005,10,15,99,109,672,104,0,104,1,21102,1,847069688728,1,21101,0,367,0,1106,0,471,21102,386577216404,1,1,21102,378,1,0,1105,1,471,3,10,104,0,104,1,3,10,104,0,104,0,3,10,104,0,104,1,3,10,104,0,104,1,3,10,104,0,104,0,3,10,104,0,104,1,21101,97952923867,0,1,21102,425,1,0,1106,0,471,21101,0,29033143319,1,21102,436,1,0,1105,1,471,3,10,104,0,104,0,3,10,104,0,104,0,21102,1,868410614628,1,21101,0,459,0,1105,1,471,21101,837896909672,0,1,21101,0,470,0,1105,1,471,99,109,2,22102,1,-1,1,21101,40,0,2,21102,502,1,3,21102,492,1,0,1106,0,535,109,-2,2105,1,0,0,1,0,0,1,109,2,3,10,204,-1,1001,497,498,513,4,0,1001,497,1,497,108,4,497,10,1006,10,529,1102,1,0,497,109,-2,2105,1,0,0,109,4,2101,0,-1,534,1207,-3,0,10,1006,10,552,21101,0,0,-3,22101,0,-3,1,22101,0,-2,2,21102,1,1,3,21101,571,0,0,1106,0,576,109,-4,2106,0,0,109,5,1207,-3,1,10,1006,10,599,2207,-4,-2,10,1006,10,599,21202,-4,1,-4,1105,1,667,21202,-4,1,1,21201,-3,-1,2,21202,-2,2,3,21102,1,618,0,1106,0,576,21201,1,0,-4,21101,0,1,-1,2207,-4,-2,10,1006,10,637,21102,0,1,-1,22202,-2,-1,-2,2107,0,-3,10,1006,10,659,21202,-1,1,1,21101,659,0,0,106,0,534,21202,-2,-1,-2,22201,-4,-2,-4,109,-5,2105,1,0 diff --git a/input/day12.in b/input/day12.in deleted file mode 100644 index 071ed71..0000000 --- a/input/day12.in +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/input/day13.in b/input/day13.in deleted file mode 100644 index bb41b45..0000000 --- a/input/day13.in +++ /dev/null @@ -1 +0,0 @@ -1,380,379,385,1008,2617,649812,381,1005,381,12,99,109,2618,1101,0,0,383,1102,1,0,382,21001,382,0,1,21002,383,1,2,21102,37,1,0,1106,0,578,4,382,4,383,204,1,1001,382,1,382,1007,382,43,381,1005,381,22,1001,383,1,383,1007,383,23,381,1005,381,18,1006,385,69,99,104,-1,104,0,4,386,3,384,1007,384,0,381,1005,381,94,107,0,384,381,1005,381,108,1105,1,161,107,1,392,381,1006,381,161,1101,-1,0,384,1105,1,119,1007,392,41,381,1006,381,161,1101,0,1,384,21001,392,0,1,21101,0,21,2,21102,0,1,3,21102,1,138,0,1106,0,549,1,392,384,392,21001,392,0,1,21102,21,1,2,21102,1,3,3,21102,161,1,0,1105,1,549,1101,0,0,384,20001,388,390,1,20101,0,389,2,21102,1,180,0,1106,0,578,1206,1,213,1208,1,2,381,1006,381,205,20001,388,390,1,20101,0,389,2,21102,205,1,0,1105,1,393,1002,390,-1,390,1102,1,1,384,21002,388,1,1,20001,389,391,2,21101,228,0,0,1105,1,578,1206,1,261,1208,1,2,381,1006,381,253,20102,1,388,1,20001,389,391,2,21102,1,253,0,1105,1,393,1002,391,-1,391,1101,0,1,384,1005,384,161,20001,388,390,1,20001,389,391,2,21101,0,279,0,1106,0,578,1206,1,316,1208,1,2,381,1006,381,304,20001,388,390,1,20001,389,391,2,21101,304,0,0,1106,0,393,1002,390,-1,390,1002,391,-1,391,1101,0,1,384,1005,384,161,20102,1,388,1,21002,389,1,2,21102,0,1,3,21101,0,338,0,1105,1,549,1,388,390,388,1,389,391,389,21002,388,1,1,20102,1,389,2,21102,4,1,3,21101,0,365,0,1106,0,549,1007,389,22,381,1005,381,75,104,-1,104,0,104,0,99,0,1,0,0,0,0,0,0,361,19,18,1,1,21,109,3,21201,-2,0,1,22101,0,-1,2,21101,0,0,3,21101,0,414,0,1106,0,549,21201,-2,0,1,22102,1,-1,2,21102,429,1,0,1105,1,601,2102,1,1,435,1,386,0,386,104,-1,104,0,4,386,1001,387,-1,387,1005,387,451,99,109,-3,2106,0,0,109,8,22202,-7,-6,-3,22201,-3,-5,-3,21202,-4,64,-2,2207,-3,-2,381,1005,381,492,21202,-2,-1,-1,22201,-3,-1,-3,2207,-3,-2,381,1006,381,481,21202,-4,8,-2,2207,-3,-2,381,1005,381,518,21202,-2,-1,-1,22201,-3,-1,-3,2207,-3,-2,381,1006,381,507,2207,-3,-4,381,1005,381,540,21202,-4,-1,-1,22201,-3,-1,-3,2207,-3,-4,381,1006,381,529,21202,-3,1,-7,109,-8,2105,1,0,109,4,1202,-2,43,566,201,-3,566,566,101,639,566,566,1202,-1,1,0,204,-3,204,-2,204,-1,109,-4,2106,0,0,109,3,1202,-1,43,593,201,-2,593,593,101,639,593,593,21002,0,1,-2,109,-3,2106,0,0,109,3,22102,23,-2,1,22201,1,-1,1,21101,0,499,2,21101,0,275,3,21101,0,989,4,21101,630,0,0,1105,1,456,21201,1,1628,-2,109,-3,2105,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,2,2,2,0,2,2,2,2,2,2,0,2,2,0,2,2,2,2,2,0,2,0,2,2,0,0,0,0,2,2,2,2,2,0,0,0,2,2,0,1,1,0,0,0,0,0,0,2,0,2,0,2,2,0,2,0,0,2,0,2,2,2,0,2,2,2,2,0,2,0,2,2,2,2,2,0,2,0,2,2,2,0,1,1,0,2,0,2,0,0,2,2,0,2,0,2,2,2,2,2,0,2,0,0,2,2,2,2,2,2,2,2,2,0,0,0,0,2,0,2,2,2,2,2,0,1,1,0,2,2,2,2,2,0,2,2,2,2,2,0,2,2,2,2,2,2,0,0,0,0,2,2,0,0,0,2,2,2,0,0,0,0,2,0,0,2,0,0,1,1,0,2,2,2,2,0,0,2,2,2,2,2,2,2,0,0,0,0,2,0,2,2,2,2,0,0,2,0,0,2,0,0,2,2,2,2,0,0,2,2,0,1,1,0,2,2,2,0,2,2,0,0,2,2,0,2,2,2,0,0,2,0,2,2,0,2,0,2,2,2,2,2,2,0,2,2,2,2,2,2,0,2,2,0,1,1,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,0,0,0,2,2,2,2,0,2,2,2,2,0,2,2,2,2,2,2,0,1,1,0,0,0,0,2,0,2,2,0,2,2,2,0,0,0,2,0,0,2,0,2,0,2,2,2,0,2,0,2,2,2,2,2,2,0,2,2,0,2,0,0,1,1,0,2,2,2,2,2,0,2,0,0,2,0,2,2,0,2,0,2,2,2,0,2,2,2,0,2,0,0,2,0,2,2,0,2,0,2,0,2,2,2,0,1,1,0,2,2,2,0,0,2,2,2,2,0,2,0,0,0,2,0,0,2,2,2,0,0,2,0,2,0,2,2,2,2,0,2,0,2,0,2,0,0,2,0,1,1,0,2,2,2,2,2,0,0,2,2,0,0,0,2,0,2,0,2,0,0,2,0,0,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,0,1,1,0,2,2,2,0,2,0,0,2,0,0,2,0,2,2,0,0,2,0,2,2,0,2,2,2,2,2,0,2,0,0,2,2,2,0,2,0,2,0,2,0,1,1,0,2,2,2,2,2,2,0,2,0,0,2,2,2,0,2,2,0,2,0,0,2,0,0,0,0,2,2,0,0,2,0,0,2,0,0,0,0,2,2,0,1,1,0,2,2,2,2,2,2,0,2,0,0,0,0,0,2,0,0,0,2,2,2,2,0,2,0,2,0,0,0,0,2,0,0,2,2,2,0,0,0,2,0,1,1,0,0,2,0,0,2,0,2,0,2,2,2,0,2,0,2,0,2,2,2,0,0,2,2,0,2,0,0,0,2,2,2,0,0,0,2,2,2,2,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,50,83,69,55,5,36,88,27,48,45,55,26,23,56,75,93,20,97,93,90,50,24,84,49,93,23,74,88,42,37,31,74,42,93,56,81,50,48,64,26,80,53,72,51,63,25,30,74,85,93,5,1,78,10,85,22,20,18,92,98,97,29,52,22,67,48,79,50,19,64,11,1,29,71,44,32,19,30,36,73,78,28,13,42,33,74,56,38,1,55,94,9,53,16,26,24,75,3,17,67,18,19,7,56,61,22,71,85,2,24,80,20,6,33,12,67,38,81,41,59,81,38,17,7,61,10,77,36,96,85,10,71,76,68,90,62,93,16,83,61,59,42,83,81,10,94,35,38,66,27,61,26,61,61,65,1,42,65,83,30,23,96,39,87,30,38,47,97,48,77,38,23,23,26,36,58,77,33,44,23,21,49,72,7,46,73,43,86,8,71,92,43,16,1,72,40,55,10,74,5,84,24,92,24,10,47,7,49,9,23,6,80,18,78,88,50,31,56,45,35,74,62,68,74,45,78,5,20,75,83,72,13,59,66,76,63,49,97,54,9,16,32,39,7,45,16,32,57,71,18,80,90,54,8,27,53,5,10,2,74,79,34,2,76,21,80,75,62,88,46,32,26,5,1,60,14,73,60,7,69,93,36,4,63,94,89,2,55,30,5,7,28,71,72,45,44,3,98,43,42,28,63,69,52,61,67,79,80,55,1,39,1,58,6,82,64,81,11,16,41,50,23,31,94,98,75,96,94,40,98,97,20,88,94,64,17,61,60,63,26,76,87,73,80,30,15,61,90,61,16,41,86,52,67,90,58,85,33,29,59,92,45,10,82,22,65,62,43,14,92,47,17,25,15,55,55,25,70,52,63,86,73,86,34,43,7,2,94,93,13,73,28,88,23,12,82,16,79,56,36,32,52,62,82,81,57,39,88,70,25,50,14,80,52,56,11,81,14,15,83,36,84,76,74,21,19,56,1,29,44,68,87,42,68,92,54,13,76,48,48,66,89,49,64,32,59,53,30,57,20,94,72,42,2,77,7,56,54,27,17,67,67,56,94,8,58,28,81,9,72,64,20,95,92,7,61,7,46,44,2,81,17,78,7,32,64,40,17,47,62,57,19,61,36,88,10,71,6,88,39,43,48,2,50,30,20,39,75,9,46,78,17,56,88,96,20,50,7,14,12,67,7,23,77,94,58,44,96,65,48,44,60,52,65,88,39,45,13,63,37,16,2,26,41,95,73,45,37,29,35,82,30,14,90,18,29,33,92,23,63,51,79,17,86,76,83,85,20,43,48,51,28,94,50,77,74,90,5,33,52,47,14,76,70,3,59,28,95,78,82,1,6,59,97,38,68,60,68,95,31,98,8,32,71,70,25,47,76,75,13,35,60,19,45,7,49,34,61,93,21,79,81,52,17,82,28,69,35,72,10,12,55,25,45,9,67,60,67,27,97,26,13,30,4,6,64,34,36,88,19,90,50,35,32,6,38,15,18,88,10,42,68,71,31,29,45,90,50,85,13,69,80,91,4,21,81,18,21,38,44,42,49,54,47,61,43,17,54,89,47,13,27,6,67,96,54,80,54,85,32,1,39,18,28,98,55,30,2,90,43,9,48,43,54,42,21,3,50,49,2,47,23,51,2,66,88,80,24,66,31,28,68,15,93,34,55,69,86,92,16,13,69,26,78,20,84,16,87,1,51,91,65,89,70,31,28,48,28,81,54,40,81,77,25,64,98,41,46,30,50,9,33,58,24,31,62,41,92,4,40,12,53,32,50,62,78,80,36,90,36,47,9,34,13,91,36,74,82,60,31,74,77,33,16,79,10,68,56,52,43,71,76,31,65,14,68,49,73,36,55,76,48,37,3,33,85,8,42,92,44,66,22,84,54,98,50,8,21,70,63,89,53,21,20,72,9,46,38,27,20,76,66,57,15,73,23,34,36,38,46,53,76,86,45,75,50,27,25,81,80,68,95,73,12,89,58,15,30,79,63,35,62,53,15,27,64,89,21,58,65,80,16,92,64,29,89,16,71,23,68,46,30,17,41,67,4,16,84,25,9,78,46,18,85,3,26,32,12,45,49,79,11,4,65,82,17,21,29,60,1,20,16,93,72,7,17,88,67,75,3,24,73,73,71,54,35,95,57,80,16,7,44,8,58,83,68,87,21,41,90,7,85,32,22,41,23,47,30,56,94,27,50,65,62,36,74,51,39,21,36,44,47,96,15,59,72,97,84,25,649812 \ No newline at end of file diff --git a/input/day14.in b/input/day14.in deleted file mode 100644 index 438d38f..0000000 --- a/input/day14.in +++ /dev/null @@ -1,61 +0,0 @@ -8 LHFV => 3 PMVMQ -2 ZXNM, 1 PSVLS, 4 GRDNT, 26 GLZH, 3 VHJX, 16 BGPF, 1 LHVTN => 4 BTQL -10 NKHSG, 20 FCPC, 11 GRDNT => 5 HDJB -6 WPZN, 1 LHFV => 7 BGPF -1 WDXT, 1 PLCNZ => 3 QHFKR -12 LCHZ => 1 TPXCK -11 LSNG => 4 XFGH -195 ORE => 4 GRNC -8 XFGQ => 1 GRDNT -1 FBRG => 5 LCHZ -7 XZBJ, 8 RSZF, 9 SVDX => 9 LWDP -20 WDXT => 5 RQFRT -1 LXQWG, 1 GLZH => 6 SDLJ -4 XFGH => 1 GCZLZ -1 WPZN => 1 FBRG -19 XZBJ => 5 WXGV -1 GDXC => 6 WDXT -1 WXGV, 1 NKHSG, 2 LWDP => 5 FCNPB -4 LWDP, 5 BGPF => 9 KLRB -1 GMRN => 4 GLZH -1 RQFRT => 5 SVDX -2 HWKG => 7 LHFV -2 LCHZ, 13 JTJT, 10 TPXCK => 3 RSZF -29 MZTVH => 6 TSGR -9 NRFLK, 1 SVDX => 5 NKHSG -123 ORE => 9 GDXC -1 PZPBV, 21 PMVMQ, 1 GCZLZ => 8 SKZGB -3 GRNC, 5 GDXC => 8 QZVM -6 VTDQ, 13 TCQW, 3 FCNPB, 48 PSVLS, 3 RLNF, 73 BTQL, 5 MHRVG, 26 BGPF, 26 HDJB, 5 XFGQ, 6 HTFL => 1 FUEL -5 QZVM, 2 JTJT => 1 PXKHG -3 LSNG, 1 PMVMQ => 8 VTDQ -31 XFGH => 1 FCPC -9 PSVLS => 8 FWGTF -1 GRNC => 3 WPZN -16 JBXDX, 4 GRNC => 6 HWKG -1 SKZGB, 5 RSZF => 4 XZBJ -134 ORE => 9 CTDRZ -1 SVDX, 2 TPXCK => 7 JTJT -6 RQFRT, 4 KBCW => 3 BGNLR -12 KLRB, 12 LHFV => 4 HTFL -2 GMRN => 6 XFGQ -16 WNSW, 12 SKZGB => 8 LXQWG -2 NRFLK, 2 CTDRZ => 9 JBXDX -1 PZPBV => 8 RLNF -2 JTJT, 5 GCZLZ => 3 WNSW -5 WXGV, 2 LCHZ => 2 SCDS -1 QHFKR => 3 GMRN -10 JTJT, 2 HRCG => 8 KBCW -7 HWKG => 4 PSVLS -7 WNSW, 1 PXKHG, 3 BGNLR => 9 MZTVH -15 TPXCK, 11 LHFV => 5 HRCG -1 LSNG, 1 HWKG => 3 PZPBV -7 BGPF => 9 PLCNZ -1 ZGWT => 6 ZXNM -26 NKHSG, 1 LHFV, 2 JTJT, 26 WXGV, 6 SDLJ, 1 KLRB, 1 TSGR => 8 TCQW -154 ORE => 4 NRFLK -1 GMRN => 3 VHJX -5 QZVM, 3 GDXC => 7 LSNG -5 WNSW => 5 ZGWT -6 QHFKR, 8 PZPBV, 10 FBRG, 13 FWGTF, 1 LHVTN, 4 SCDS, 8 VHJX, 7 TSGR => 6 MHRVG -12 GLZH => 5 LHVTN \ No newline at end of file diff --git a/input/day15.in b/input/day15.in deleted file mode 100644 index 79901fe..0000000 --- a/input/day15.in +++ /dev/null @@ -1 +0,0 @@ -3,1033,1008,1033,1,1032,1005,1032,31,1008,1033,2,1032,1005,1032,58,1008,1033,3,1032,1005,1032,81,1008,1033,4,1032,1005,1032,104,99,1002,1034,1,1039,1001,1036,0,1041,1001,1035,-1,1040,1008,1038,0,1043,102,-1,1043,1032,1,1037,1032,1042,1105,1,124,1001,1034,0,1039,102,1,1036,1041,1001,1035,1,1040,1008,1038,0,1043,1,1037,1038,1042,1105,1,124,1001,1034,-1,1039,1008,1036,0,1041,101,0,1035,1040,102,1,1038,1043,1001,1037,0,1042,1106,0,124,1001,1034,1,1039,1008,1036,0,1041,1001,1035,0,1040,102,1,1038,1043,1001,1037,0,1042,1006,1039,217,1006,1040,217,1008,1039,40,1032,1005,1032,217,1008,1040,40,1032,1005,1032,217,1008,1039,9,1032,1006,1032,165,1008,1040,5,1032,1006,1032,165,1101,0,2,1044,1105,1,224,2,1041,1043,1032,1006,1032,179,1102,1,1,1044,1106,0,224,1,1041,1043,1032,1006,1032,217,1,1042,1043,1032,1001,1032,-1,1032,1002,1032,39,1032,1,1032,1039,1032,101,-1,1032,1032,101,252,1032,211,1007,0,40,1044,1106,0,224,1101,0,0,1044,1106,0,224,1006,1044,247,102,1,1039,1034,101,0,1040,1035,101,0,1041,1036,1001,1043,0,1038,1001,1042,0,1037,4,1044,1106,0,0,26,29,83,66,1,36,14,44,33,12,3,15,20,56,9,35,51,55,6,20,13,71,15,23,94,38,45,15,47,30,89,39,11,55,5,9,47,29,41,36,78,12,4,65,48,66,36,94,76,30,63,41,32,1,73,1,35,65,87,46,18,90,11,44,30,73,87,8,38,46,17,78,51,34,19,53,37,26,20,24,46,64,17,6,26,41,10,62,14,88,23,94,13,55,5,45,10,39,83,99,32,34,72,30,58,33,71,47,21,38,97,38,46,41,18,39,37,8,86,55,35,4,92,19,21,53,61,6,55,69,16,85,62,26,63,17,80,33,10,53,91,2,37,94,37,93,7,97,18,55,54,36,17,62,89,12,92,32,69,4,46,47,19,89,25,12,51,91,9,1,71,35,56,39,98,48,7,49,24,95,15,45,2,1,93,82,19,7,11,70,30,64,28,27,58,4,39,30,94,72,33,43,90,98,26,32,70,1,81,25,35,47,17,31,92,15,73,13,27,72,65,30,67,2,22,89,77,30,47,12,58,26,79,22,37,74,41,3,42,30,39,67,24,18,62,98,19,59,95,25,6,67,42,35,85,51,48,7,63,17,67,53,45,13,25,43,1,54,4,65,55,20,73,32,70,1,33,39,93,88,19,35,56,21,13,53,73,31,21,44,73,31,13,69,30,42,26,51,25,90,16,49,9,93,50,28,60,24,18,61,23,11,98,19,45,77,12,61,31,3,66,56,4,77,24,59,87,31,38,65,67,7,9,23,71,9,59,35,55,83,22,12,94,17,67,87,96,63,8,29,32,34,15,55,39,60,41,74,39,81,47,51,25,26,57,28,18,60,84,20,16,66,42,14,25,16,94,2,22,74,85,19,63,32,9,19,11,91,44,34,21,1,56,12,87,8,52,18,56,7,90,5,86,81,24,98,21,9,80,59,68,10,80,53,18,75,50,9,14,43,26,29,57,86,39,41,93,3,69,55,16,84,15,22,84,30,72,19,13,15,19,80,97,79,32,68,77,82,30,19,4,71,45,67,14,95,17,54,80,88,25,13,80,41,37,96,15,28,26,33,73,32,45,79,21,52,23,98,82,21,16,13,64,32,39,93,17,33,95,61,36,12,21,3,84,4,88,22,26,59,80,27,82,2,85,79,29,33,52,17,23,95,8,64,16,56,23,42,43,18,41,11,9,84,42,62,4,67,17,98,76,99,1,16,72,72,10,79,19,76,4,54,9,99,34,33,7,97,85,19,76,93,38,6,90,37,90,2,83,61,19,43,39,2,91,17,60,21,79,2,32,94,38,32,7,64,8,14,7,68,23,28,75,24,73,50,29,63,22,89,4,51,66,2,7,33,82,13,23,84,81,23,55,68,15,27,9,97,27,79,42,86,75,56,13,95,74,5,88,25,44,99,33,14,24,29,21,78,4,15,75,32,92,74,11,56,24,57,10,28,73,8,10,90,77,30,96,8,60,3,71,20,41,9,33,89,38,74,95,4,95,35,13,18,55,10,81,9,60,17,67,7,34,48,48,15,54,79,37,66,43,22,64,28,28,4,91,5,9,92,30,64,37,98,66,15,92,2,3,25,70,25,33,61,56,25,70,58,30,41,97,18,54,10,49,45,3,1,30,57,30,46,8,55,79,39,58,46,35,19,38,80,86,4,36,75,29,62,39,71,2,41,6,66,36,99,21,61,39,72,3,48,29,43,31,59,84,71,12,52,61,82,11,56,23,51,30,60,88,65,35,48,24,58,76,49,93,51,33,72,0,0,21,21,1,10,1,0,0,0,0,0,0 diff --git a/input/day16.in b/input/day16.in deleted file mode 100644 index b8d468b..0000000 --- a/input/day16.in +++ /dev/null @@ -1 +0,0 @@ -59705379150220188753316412925237003623341873502562165618681895846838956306026981091618902964505317589975353803891340688726319912072762197208600522256226277045196745275925595285843490582257194963750523789260297737947126704668555847149125256177428007606338263660765335434914961324526565730304103857985860308906002394989471031058266433317378346888662323198499387391755140009824186662950694879934582661048464385141787363949242889652092761090657224259182589469166807788651557747631571357207637087168904251987880776566360681108470585488499889044851694035762709053586877815115448849654685763054406911855606283246118699187059424077564037176787976681309870931 \ No newline at end of file diff --git a/input/day17.in b/input/day17.in deleted file mode 100644 index 9b6105d..0000000 --- a/input/day17.in +++ /dev/null @@ -1 +0,0 @@ -1,330,331,332,109,3132,1102,1,1182,16,1101,1467,0,24,101,0,0,570,1006,570,36,101,0,571,0,1001,570,-1,570,1001,24,1,24,1105,1,18,1008,571,0,571,1001,16,1,16,1008,16,1467,570,1006,570,14,21102,58,1,0,1106,0,786,1006,332,62,99,21102,1,333,1,21102,73,1,0,1106,0,579,1101,0,0,572,1101,0,0,573,3,574,101,1,573,573,1007,574,65,570,1005,570,151,107,67,574,570,1005,570,151,1001,574,-64,574,1002,574,-1,574,1001,572,1,572,1007,572,11,570,1006,570,165,101,1182,572,127,1001,574,0,0,3,574,101,1,573,573,1008,574,10,570,1005,570,189,1008,574,44,570,1006,570,158,1105,1,81,21101,0,340,1,1106,0,177,21101,0,477,1,1105,1,177,21101,514,0,1,21102,176,1,0,1106,0,579,99,21102,1,184,0,1106,0,579,4,574,104,10,99,1007,573,22,570,1006,570,165,1002,572,1,1182,21102,1,375,1,21101,0,211,0,1106,0,579,21101,1182,11,1,21102,1,222,0,1106,0,979,21102,388,1,1,21102,233,1,0,1105,1,579,21101,1182,22,1,21101,244,0,0,1106,0,979,21102,1,401,1,21101,255,0,0,1105,1,579,21101,1182,33,1,21102,266,1,0,1105,1,979,21102,1,414,1,21102,1,277,0,1105,1,579,3,575,1008,575,89,570,1008,575,121,575,1,575,570,575,3,574,1008,574,10,570,1006,570,291,104,10,21102,1,1182,1,21101,313,0,0,1105,1,622,1005,575,327,1101,0,1,575,21102,1,327,0,1106,0,786,4,438,99,0,1,1,6,77,97,105,110,58,10,33,10,69,120,112,101,99,116,101,100,32,102,117,110,99,116,105,111,110,32,110,97,109,101,32,98,117,116,32,103,111,116,58,32,0,12,70,117,110,99,116,105,111,110,32,65,58,10,12,70,117,110,99,116,105,111,110,32,66,58,10,12,70,117,110,99,116,105,111,110,32,67,58,10,23,67,111,110,116,105,110,117,111,117,115,32,118,105,100,101,111,32,102,101,101,100,63,10,0,37,10,69,120,112,101,99,116,101,100,32,82,44,32,76,44,32,111,114,32,100,105,115,116,97,110,99,101,32,98,117,116,32,103,111,116,58,32,36,10,69,120,112,101,99,116,101,100,32,99,111,109,109,97,32,111,114,32,110,101,119,108,105,110,101,32,98,117,116,32,103,111,116,58,32,43,10,68,101,102,105,110,105,116,105,111,110,115,32,109,97,121,32,98,101,32,97,116,32,109,111,115,116,32,50,48,32,99,104,97,114,97,99,116,101,114,115,33,10,94,62,118,60,0,1,0,-1,-1,0,1,0,0,0,0,0,0,1,0,10,0,109,4,1202,-3,1,587,20102,1,0,-1,22101,1,-3,-3,21101,0,0,-2,2208,-2,-1,570,1005,570,617,2201,-3,-2,609,4,0,21201,-2,1,-2,1105,1,597,109,-4,2105,1,0,109,5,2102,1,-4,630,20102,1,0,-2,22101,1,-4,-4,21101,0,0,-3,2208,-3,-2,570,1005,570,781,2201,-4,-3,653,20101,0,0,-1,1208,-1,-4,570,1005,570,709,1208,-1,-5,570,1005,570,734,1207,-1,0,570,1005,570,759,1206,-1,774,1001,578,562,684,1,0,576,576,1001,578,566,692,1,0,577,577,21101,702,0,0,1105,1,786,21201,-1,-1,-1,1105,1,676,1001,578,1,578,1008,578,4,570,1006,570,724,1001,578,-4,578,21101,0,731,0,1106,0,786,1106,0,774,1001,578,-1,578,1008,578,-1,570,1006,570,749,1001,578,4,578,21101,0,756,0,1105,1,786,1105,1,774,21202,-1,-11,1,22101,1182,1,1,21102,1,774,0,1106,0,622,21201,-3,1,-3,1106,0,640,109,-5,2106,0,0,109,7,1005,575,802,21002,576,1,-6,20101,0,577,-5,1105,1,814,21101,0,0,-1,21101,0,0,-5,21102,1,0,-6,20208,-6,576,-2,208,-5,577,570,22002,570,-2,-2,21202,-5,45,-3,22201,-6,-3,-3,22101,1467,-3,-3,1201,-3,0,843,1005,0,863,21202,-2,42,-4,22101,46,-4,-4,1206,-2,924,21102,1,1,-1,1105,1,924,1205,-2,873,21101,0,35,-4,1105,1,924,2102,1,-3,878,1008,0,1,570,1006,570,916,1001,374,1,374,2102,1,-3,895,1102,2,1,0,1201,-3,0,902,1001,438,0,438,2202,-6,-5,570,1,570,374,570,1,570,438,438,1001,578,558,921,21001,0,0,-4,1006,575,959,204,-4,22101,1,-6,-6,1208,-6,45,570,1006,570,814,104,10,22101,1,-5,-5,1208,-5,37,570,1006,570,810,104,10,1206,-1,974,99,1206,-1,974,1102,1,1,575,21101,0,973,0,1106,0,786,99,109,-7,2105,1,0,109,6,21101,0,0,-4,21102,0,1,-3,203,-2,22101,1,-3,-3,21208,-2,82,-1,1205,-1,1030,21208,-2,76,-1,1205,-1,1037,21207,-2,48,-1,1205,-1,1124,22107,57,-2,-1,1205,-1,1124,21201,-2,-48,-2,1106,0,1041,21102,1,-4,-2,1105,1,1041,21101,0,-5,-2,21201,-4,1,-4,21207,-4,11,-1,1206,-1,1138,2201,-5,-4,1059,1202,-2,1,0,203,-2,22101,1,-3,-3,21207,-2,48,-1,1205,-1,1107,22107,57,-2,-1,1205,-1,1107,21201,-2,-48,-2,2201,-5,-4,1090,20102,10,0,-1,22201,-2,-1,-2,2201,-5,-4,1103,2101,0,-2,0,1106,0,1060,21208,-2,10,-1,1205,-1,1162,21208,-2,44,-1,1206,-1,1131,1106,0,989,21102,1,439,1,1105,1,1150,21101,0,477,1,1106,0,1150,21102,1,514,1,21102,1,1149,0,1105,1,579,99,21101,1157,0,0,1106,0,579,204,-2,104,10,99,21207,-3,22,-1,1206,-1,1138,1201,-5,0,1176,2102,1,-4,0,109,-6,2106,0,0,8,9,36,1,7,1,36,1,1,13,30,1,7,1,5,1,30,1,7,1,5,1,7,11,12,1,7,1,5,1,7,1,9,1,12,1,7,1,5,1,7,1,1,13,8,1,7,1,5,1,7,1,1,1,7,1,3,1,8,1,7,1,5,1,7,1,1,1,7,1,3,1,8,1,7,1,5,1,7,1,1,1,7,1,3,10,5,9,1,13,3,1,3,1,14,1,1,1,7,1,5,1,1,1,3,1,3,1,3,1,8,9,5,9,1,1,3,1,3,1,3,1,8,1,5,1,7,1,1,1,7,1,3,1,3,1,3,1,8,1,5,1,7,1,1,1,7,1,3,1,3,1,3,1,8,1,5,1,7,1,1,1,7,1,3,1,3,1,3,1,8,1,5,1,7,1,1,1,7,9,3,1,8,1,5,1,7,1,1,1,11,1,7,1,8,1,5,1,7,1,1,11,1,9,8,1,5,1,7,1,11,1,18,13,1,1,11,1,24,1,5,1,1,1,11,1,24,9,11,1,30,1,13,1,30,1,13,1,30,1,13,1,30,1,13,9,22,1,21,1,22,11,11,1,32,1,11,1,32,1,11,1,32,1,11,1,32,1,11,1,32,1,11,1,32,1,11,1,32,1,11,1,32,13,2 diff --git a/input/day18.in b/input/day18.in deleted file mode 100644 index fe32fb3..0000000 --- a/input/day18.in +++ /dev/null @@ -1,81 +0,0 @@ -################################################################################# -#...#.................#...#.........#...#....j......................#.......#...# -#.###.###########.#####.#.###.###.#.###.#.###############.#########.#.###.#.#.#.# -#.#...#.....#...#.......#...#...#.#...#.#.#.........#...#...#...#...#.#...#...#.# -#.#.###.###.###.###########.#.###.###.#.#.#####.###.#.#.###.#.###.###.#.#######.# -#...#...#.#...#.....#...#...#.#...#.....#.#.....#.#.#.#.#...#...#.#p..#...#...#.# -#.#####.#.###.###.###.#.#.###.#.#######.#.#.#####.#.#.#.#.###.#.#.###.###.#.#.### -#...#...#.........#r..#...#...#.......#.#.#...#.M.#...#.#...#.#.....#...#.#.#...# -###.#.###########.#.#######.#########.#.#.###.#.#######.###.#######.#####.#.###.# -#...#.#....i..#...#.......#....e#...#.#.#.....#...#.......#.......#.......#...#.# -#.###.#.#####.#.#########.#####.#.#.#.###.#######.#.#######.#####.#.#########.#.# -#...#.#.#...#.#.....#.....#...#.#.#.#...#.#.....#.....#...#.#.....#.#.......#.#.# -###.#.#.#.#.#Y#####.#.#####.###.#.#.###.#.#.###.#######.#.###.###.###.#####.#.#.# -#d#...#.#.#.....#...#...#.....#...#.#...#.#.#...#...#...#...#.#...#...#...#...#.# -#.###.#.#######.###.###.#.###.###.###.#.###.#.###.#.#.#####.#.#####.###.#######.# -#...#.#.......#...#.#...#...#...#.#...#.#...#.....#...#...#...#...#.#.........#.# -#.#.#.#######.###.###.#####.#.###.#.###.#.###########.#.#.###.#.#.#.#####.#####.# -#.#.#.#.....#.#...#...#...#.#.....#.#...#.....#.......#.#.#...#.#...#...#.#..a..# -###.#.#####.#.#.###.###.#.#.#######.#####.###.#####.###.#.#####.#####.#.#.#.##### -#...#.......#.#...#.#...#.#.#.......#...#.#.#.....#...#.#.#...........#...#.....# -#.#########.#.###.#U###.###.#.###.###.#.#.#.#####.#####.#.#.#############.#####.# -#...#.......#q..#...#.#.....#.#...#...#.#.....#.#.#.....#...#.#...#.........#...# -#.#.#.#########.#####.#######.###.#.###.#####.#.#.#.#########.#.#.#.#######.#.#.# -#.#...#.......#.....#..v#...#...#.#...#.#...#g..#.#.#.......#.#.#.#...#...#.#.#.# -#.#####.#.#########.###.#.#.###.#####.#.#.#####.#.#.###.###.#.#.#.###.#.#.#.#.### -#.....#.#.#...#...#...#...#...#.#.....#.#.#...#.#...#...#.#.#.#.#.....#.#.#.#...# -#####.###.#.#.#.#.###.#######.#.#.#####.#.#.#.#.#####.###.#.#.###.#####.#.#.###.# -#.....#...#f#.H.#.......#...#n#...#.....#.#.#.#.......#...#.#...#.#.....#.#.#...# -#.#####.#.#.#########.###Z#.#.#.###.###.#.#.#.#########.###.###.#.#.#####.###.#.# -#...#.G.#.#.....#.....#...#...#...#...#.#...#.....#.........#..h#.#.#.....#...#.# -###.#.###.#####.###.###.#########.###.#.#.#####.#.#.#########.#####.###.###.###.# -#...#...#.#...#...#...#.#.#.....#...#.#.#.....#.#.#...#.......#...#...#.....#...# -#.#####.#.###.###.#####.#.#.###.###.#.#.#.#####.#.###.#.#######.#.#.#.#######.### -#.#...#.#.....#.#...#...#.....#.....#.#.#.#.....#.#...#.#.......#.#.#.#.........# -#.#.#.#.#####.#.###.#.###############.#.###.#####.#.###Q###.#.###.###.#########.# -#.#.#.#...#...#...#...#.......#...#...#.#...#...#.#.#.#...#.#...#...#.........#.# -#.#.#.###L#.###.#.#####.#.###.#.#.#.#####.###.#.###.#.###.#####.###.#.#######.### -#...#...#.#.#...#...#..t#...#...#.#.....#.....#...#.#...#.....#.#.#.#.#.....#..u# -#######.#.#.#.#####.#######.#####.#####.#.#######.#.###.#####.#.#.#.###.###.###.# -#.........#...#.............#...................#...........#...#......y#.......# -#######################################.@.####################################### -#.................#...........#.......................#.......#.....#.......#...# -#.###.#######.#####.#####.###.#.#######.#.#######.#####.#C###.#.#.#.#.#.#####.#.# -#.#...#...#...#.....#.#...#.#.#.#.......#.#.....#.......#.#.#.#.#.#.#.#.......#.# -#.#.###.#.#.###.#####.#.###.#.###.#####.#.#.###.#########.#.#.#.#.###.#########.# -#.#.....#.#...#.....#.#.#......c#.#.....#...#.#...#...#...#...#.#...#...#...#...# -#.#######.#########.#.#.#######.#.#####.#####.###.#.###.#.#####.###.###.#.#.#.### -#.#...#...#....x......#.......#...#...#.#.......#...#...#.#...#.#l....#.#.#.#...# -#.#.###.###.#########.#######.#####.#.###.###.#####.#.#####.#.#.#.###.#.#.#####.# -#.#...#...#.#.......#...#...#...#...#...#.#...#.....#.#.....#.#.#...#.#.#.#...#.# -#.###.###.#.#.#####.###.###.###.#.#####.#.#####.#####.#.#####.#.###.###.#.#.#.#.# -#.#.....#...#...#...#.#...#...#.....#.#.#.#.....#...#.T.....#.#...#.#...#.#.#...# -#.#.###########.#.###.###.#.#######.#.#.#.#.#####.#.#######.#.#X###.#.###.#.###W# -#.#.#.........#.#.#.....#.#.#.....#...#.#...#...#.#...#...#.#...#...#...#.#...#.# -#.#.#.#.###.###.#.#.#.#.#.#.#.###.#####.#.###.###.###.#.#.#####.#.#####.#.###.#.# -#.#..w#...#.#...#.#.#.#.#.#.#.#.#.#.....#.....#...#.#.#.#.....#.#..........s#.#.# -#.#######.###.###.#.#.###.#.#.#.#.#.###.#.#####.###.#.#.#####.#############.#D#.# -#...S...#...#.#.#.#.#.......#.#.....#.#.#.#.....#.....#.....#...#.....#.....#.#.# -#######.###.#.#.#.###########.#######.#.#.#.#######.###.###.###.#.###.#######.#.# -#...#.......#.#.#.#.........#...#.....#.#.#.......#.#.....#.#.....#...#.....#.#.# -#.#.#######.#.#.#.#.#######.###.#.#####.#########.#.#######.#######.###.###.#.### -#.#...#...#.#.#.#...#.....#.#...#.......#.....#...#...#.....#.K.#.......#...#...# -#.###.#.#.###.#.#########.#.#.###.#######.###.#.#####.#.###.###.#########.###.#.# -#.#.#.#.#.....#.E...#...#...#.#.#.......#z#.F...#...#...#.#...#...#.....#.#...#.# -#.#.#.#.#######.###.#.#.#####.#.#######.#.###.###.#.#####.#.#####.#.#.###.#.###.# -#...#...#.........#.#.#.......#.....#...#...#.#...#...#...I.#.....#.#.....#...#.# -###.#######.#####.#.#.#.#######.###.#.###.#.###.#####.#.#####.#####.###########.# -#.#.......#.#.....#.#.#.#.........#.#.#.#.#.#...#.....#.#...#.#...#...#.......#.# -#.#######.###.#####.###.#.#########.#.#.#.#.#.###.#####.#.#.#.###.###.###.###.#.# -#...#...#...#.#...#...#.#.#.....#...#.#.#.#...#.#.#...#...#.#k#.....#...#.#.....# -#.###.#A###.#.#.#####.#.#.#.#.#.#.###.#.#.#####.#.#.#.#.#####.#.#######.#.####### -#.#...#...#...#.....#...#.#.#.#.#.#...#.#.#.....#.#.#...#.B...#...#.....#.......# -#.#.#####.#######.#######.###.###.#.###.#.#.#####.#.#####.#######.#.#########.#.# -#.#.#...#.........#.....#...#...#.#.#...#...#.....#.#.....#.....R.#.........#.#.# -#.#.#.#######.#####.###.###.###.#.#.###J###.#.#######.#####.###.###########.###.# -#.#.#.#.......#.....#.#.#...#...#...#...#.#.#.V.....#b..#...#...#.........#.....# -#.#.#.#.#######.#####.#.#.###.#.#####.#.#.#.#######.###.#.#.#####.###.#.#######.# -#.#...#.......#.#.....#.#.#...#.#...#.#.#.#.....#..o#.O.#.#.....#.#...#.#...#...# -#.###.#######.#.#####.#.#.###.#.#.#.#.#.#.#####.#.###.###.#####.#.#.#####.#.#.### -#........m..#.........#.......#...#...#.#.N.....#.....#.......#...#.....P.#.....# -################################################################################# diff --git a/input/day19.in b/input/day19.in deleted file mode 100644 index 1d8e0c8..0000000 --- a/input/day19.in +++ /dev/null @@ -1 +0,0 @@ -109,424,203,1,21102,1,11,0,1106,0,282,21101,0,18,0,1106,0,259,1202,1,1,221,203,1,21101,0,31,0,1105,1,282,21102,38,1,0,1105,1,259,20102,1,23,2,21201,1,0,3,21102,1,1,1,21101,0,57,0,1105,1,303,2101,0,1,222,20102,1,221,3,21002,221,1,2,21101,0,259,1,21101,0,80,0,1106,0,225,21102,1,152,2,21101,91,0,0,1106,0,303,1201,1,0,223,21001,222,0,4,21101,0,259,3,21102,225,1,2,21101,0,225,1,21102,1,118,0,1105,1,225,20101,0,222,3,21102,61,1,2,21101,133,0,0,1106,0,303,21202,1,-1,1,22001,223,1,1,21102,148,1,0,1105,1,259,2101,0,1,223,21001,221,0,4,21001,222,0,3,21101,0,14,2,1001,132,-2,224,1002,224,2,224,1001,224,3,224,1002,132,-1,132,1,224,132,224,21001,224,1,1,21101,0,195,0,105,1,109,20207,1,223,2,20101,0,23,1,21102,-1,1,3,21102,214,1,0,1105,1,303,22101,1,1,1,204,1,99,0,0,0,0,109,5,2101,0,-4,249,21202,-3,1,1,21202,-2,1,2,21201,-1,0,3,21102,1,250,0,1106,0,225,22101,0,1,-4,109,-5,2106,0,0,109,3,22107,0,-2,-1,21202,-1,2,-1,21201,-1,-1,-1,22202,-1,-2,-2,109,-3,2105,1,0,109,3,21207,-2,0,-1,1206,-1,294,104,0,99,22102,1,-2,-2,109,-3,2105,1,0,109,5,22207,-3,-4,-1,1206,-1,346,22201,-4,-3,-4,21202,-3,-1,-1,22201,-4,-1,2,21202,2,-1,-1,22201,-4,-1,1,21202,-2,1,3,21101,343,0,0,1106,0,303,1105,1,415,22207,-2,-3,-1,1206,-1,387,22201,-3,-2,-3,21202,-2,-1,-1,22201,-3,-1,3,21202,3,-1,-1,22201,-3,-1,2,22101,0,-4,1,21101,0,384,0,1106,0,303,1105,1,415,21202,-4,-1,-4,22201,-4,-3,-4,22202,-3,-2,-2,22202,-2,-4,-4,22202,-3,-2,-3,21202,-4,-1,-2,22201,-3,-2,1,21201,1,0,-4,109,-5,2106,0,0 diff --git a/input/day20.in b/input/day20.in deleted file mode 100644 index 0047b8a..0000000 --- a/input/day20.in +++ /dev/null @@ -1,119 +0,0 @@ - C T N Z D C X P - Y L Z Z M V Z P - ###################################.###########.#####.#.#######.###.#######.#.####################################### - #.#.#.#.#.#...#.......#...#.........#...#...........#.#.....#.....#.......#...............#.............#...#.......# - #.#.#.#.#.###.#.###.###.###.###.###.#.#.###.#.###.###.#.#.#####.#.#.###.#########.###.#####.#.###.###.#####.#####.### - #.....#...#.....#.#.........#...#.....#...#.#.#...#.#...#.#.....#.#.#.#.....#.......#...#...#...#...#.#.....#...#.#.# - #####.###.#######.###.#.#.###.###.#.###.#########.#.#.###.#.#########.###.#####.#####.#####.#########.###.###.###.#.# - #...........#.......#.#.#.#...#...#.#.......#.......#.#...#.......#.#.........#.#.#.....#.#.......#.#.#.......#.....# - #####.#.#.#######.#.###.#####.#####.#####.#######.###.###.###.#####.#.###.#####.#.###.###.#.#.#####.#####.#.###.#.### - #.....#.#.....#.#.#.#.#...#...#.....#.....#.#.#.....#...#...#...#.......#...#.#...#.#.......#...#.#...#...#.#...#...# - #.#.#.#.#####.#.###.#.###########.#######.#.#.###.#.#####.#####.###.#.###.#.#.#.###.#.###.#######.#.#####.#####.##### - #.#.#.#.#.#.#.........#...#...#...#.#.#...#...#.#.#...#...#...#...#.#...#.#.#.#...#.....#.....#.#.....#...#.#...#...# - #.#.#.#.#.#.#.###.#.#.###.###.#####.#.#.###.#.###.#.###.#.###.###.#.#########.#.#######.#.#.###.#.#.#####.#.#.#.###.# - #.#.#.#.#.....#.#.#.#.#.....#.......#.#.#...#.....#...#.#.#.....#.#.....#...#.........#.#.#...#...#.#...#.....#.#...# - #######.#######.#####.###.###.#####.#.#.###.###.#.#######.###.#.#.#.#####.###.#######.###.#####.#.###.###.#.#.###.#.# - #.#...#.#.#.#...#...#...#.#.#.#...#.#...#.....#.#.#...#...#.#.#...#...#...#.......#.....#.......#...#...#.#.#.#.#.#.# - #.###.###.#.#.#.#.###.###.#.#####.#.#.#.###.#######.#####.#.#.#.#.#.###.###.#############.#.###.#######.#.#####.###.# - #.#.....#.....#.................#.....#.#.#...#.....#.#.#.#...#.#.#.....#.#.#...#.....#...#.#.#.#...#.......#...#...# - #.###.#.###.#####.#.#.#.#####.###.#.#.###.#.#.###.#.#.#.#.#.#.#.#####.###.#.#.###.###########.#####.###.#######.###.# - #...#.#.#...#.....#.#.#.#...#.#...#.#.#.....#...#.#.....#.#.#.#...#...#...#...#.#.#.#.....#...#.....#.....#.#.....#.# - ###.#.###.#.###.#.#########.#.###.#.###.###.#.#####.###.#.#.#######.#####.#.###.#.#.#.#######.#####.###.###.###.###.# - #...#.#.#.#.#...#.#...#.........#.#.#...#.#.#.#.......#.#.#.....#...#.....#...........#.#.#.#.#.#.....#...#.#.....#.# - ###.#.#.#######.#####.#######.#####.#####.#.#########.#.#.###.#####.#.###.#.#.#.###.###.#.#.#.#.#.#.###.###.#.#####.# - #.........#...#...#.#.#.............#...#.......#.....#...#.......#.#.#...#.#.#...#.....#...#.#...#...#.#...#.#.#.#.# - #####.#.###.#######.#.#####.#######.#.###.#.#.###.#.#######.#######.#.#.###.#.#.#########.###.###.#####.#.###.#.#.#.# - #.....#...#.....#.#...#.....#.#.#.....#...#.#.#.#.#.......#...#...#.#.#.#.#.#.#...#...#...#.........#...#.#...#.#.#.# - #####.#.#####.###.#.#########.#.###.#####.#.###.#########.#.###.###.#.#.#.#.#########.###.###.#########.#.###.#.#.#.# - #...#.#.#.#.......#.#.#.....#.#.........#.#...#...#.......#.......#.#.#...#.#.#...#...#...........#...#.#.....#.....# - ###.###.#.###.###.#.#.#.###.#.###.#.#######.###.###.#######.###.###.#.###.#.#.###.#.#.#######.#####.###.#.#.###.#.### - #.......#.#.#...#.#...#.#...#.#...#.#.....#.....#.#.....#.#...#.#.#.#.#.#.#...#...#.#.....#.....#.#.#...#.#...#.#...# - #####.#.#.#.#####.#.#######.#.#####.#.#####.#.###.###.#.#.#.#####.#.#.#.#.#.###.#####.#######.###.#.#.#####.###.##### - #...#.#.......#.......#...................#.#...#.....#.#.........#...#...#...........#.#.......#.#...#.#.....#...#.# - ###.###.#######.###.#################.#####.###########.#######.#######.#####.#.#######.#.#####.#.###.#.###.###.#.#.# - #.#...#.#.#...#.#...#.#.....#.# G U U G Y P J #...#.....#.#.#.#...#.#.#.#.#.# - #.###.#.#.#.#.#####.#.###.###.# Y M C C O Y V ###.#####.#.#.#.###.#.#.#.###.# -UM....#...#.#.#.#...#.#.#.......# #.#.#.#...#.........#.........# - #.#####.#.#.#####.#.#.#.#.#.### #.###.#.#.#.#.#.###.#.###.#.### - #.............#...#.#.#.#.#.#..LM #.#...#.#.#.#.#...#.....#.#.#.# - #.###.#####.#####.#.#.#.#.###.# #.#.###.#.#.###.###.#.###.###.# - #...#.#...#.............#.....# TL..#.....#.....#.#...#.#...#.#.# - #########.###########.###.##### #.#####.#.###########.###.#.#.# - #...#...............#.#.#.#...# #.......#...#.......#.#........PY - #.###.#.###.#.###.#####.###.### #############.#.#.############# -YO......#.#...#...#.#.......#...# WH..#.#.#.#.#.#.#.#...#.#.......# - #.#.#.#.#.#.#####.#.#.#####.### #.#.#.#.#.#.#####.#.#.###.#.### - #.#.#.#.#.#.#.......#.#.#.#.#..AM #.#.#...#.#.#.....#.#.#...#....KK - #######.###.#####.###.#.#.#.#.# #.#.#.###.#.#####.#.#.#.###.### - #...#...#...#.#.....#.........# #.......#.....#.#.#.....#...#.# - #.###########.#############.### #####.#.###.#.#.#.###.###.#.#.# - #...#.#...#.#...#.........#.#..XI #...#.#.....#.....#.....#.#.#.# - #.###.#.###.###.#.###.#######.# ###.###.#####################.# - #.#...#.#...#.#.#.#.....#.....# #...#.#.#...#.#.........#.....# - #.#.###.#.#.#.#.#.#.#####.##### ###.#.###.###.#.#.#.###.#.###.# -AW..........#.......#...........# #.#.....#...#...#.#.#.....#...# - ############################### #.#.###.#.#.#.#.###.###.###.### - #.......#.....................# CV..#...#...#...#...#...#.#.....# - ###.###.#.###.###.#.#.###.###.# #.###.###.#.#.###.###########.# - #...#...#...#.#...#.#.#...#.#..HB #.....#...#.#.#.#.#.#.....#.#..CQ - ###.#.#####.#.#####.#####.#.#.# #.###.###.#####.###.###.###.### -GL..#.#.....#.#.#...#.#...#...#.# #...#...#.#.#...#...#.#.......# - #.#.#.#.#.#.#####.###.######### ###########.###.#.#.#.#.#####.# - #...#.#.#.....#.#.......#.#...# #...#.#.........#.#...#.....#.# - ###############.#.#######.#.### ###.#.#####.###.#####.#####.#.# -PN....#.................#.....#.# #.#.....#.#...#.#...........#..JV - #.#.#.###.#.#########.###.#.#.# #.###.###.#.#.#####.#.#.###.### - #.#.#...#.#.#.........#...#.#..NZ CY............#.......#.#.#.#.#.# - ###.###.###.#.###.#######.#.#.# #######.#######.#########.###.# - #.....#...#.#.#.....#...#.#.#.# DM......#.#...#...#.#...#...#....AM - #.#.###.###########.#.#.#.#.#.# ###.#####.#.#####.#.###.#.#.#.# - #.#...........#.......#...#...# #.#.#...#.#...#.#.......#.#.#.# - ###############.###########.#.# #.#.###.#.#.###.###.#.###.#.### - #.#.....#.....#.#.......#.#.#.# #...#.....#...#...#.#.#...#...# - #.#.#.###.#######.###.###.###.# #.#.###.###.#.###.#.###.#####.# - #...#.#.#...#.#.#...#.......#.# #.#.......#.#.........#.......# - #.###.#.#.###.#.###.#####.##### #######.#.#.###.#.#####.#.###.# -YF..#.#.........#...#...#...#....PN XZ......#.#.#.#.#.#.#.....#.#.#.# - #.#.#######.###.#.###.###.#.### #####.#####.#.#.###########.### - #.#.#.#.#.......#.......#.....# #.........#.#.#.#.#...........# - ###.#.#.###.#######.#.######### #.###########.###.#.###.####### - #.......#...#.#...#.#...#.#....KY #.......#.#.....#...#.#.......# - #####.#.#####.#.#########.###.# #.#.###.#.###.###.###.#.####### -YA..#...#.....#.#...#...#.#.....# #.#...#.............#..........KY - #.###.###.###.#.#.#.#.#.#.##### #.#########.#.#.#####.#.#.#.#.# - #.......#.......#...#.........# #...#.......#.#.#.#...#.#.#.#.# - #.#######.###.###.#.#.#.#.###.# A K C G Y Y P #.#######.#.###.#.#######.##### - #.#.......#...#...#.#.#.#...#.# W K Q L A F P #...#.....#...#...#.#.#.......# - #.###.#####.###.#.#.#.#.#.###.#######.#######.###.#######.#######.#####.#####.#################.#.###.###.#.###.#.### - #.#...#...#.#...#.#.#.#.#...#.#.......#.........#.#.#.#.....#.#.#.....#.#.......#.....#...#.#...#...#.......#...#.#.# - #####.###.#######.#####.#.#######.#.#####.#####.#.#.#.#.#####.#.###.###.###.###.#.#.###.###.###.###.#.###.#####.###.# - #.........#...........#.#.......#.#.....#...#.#.#...#.#...........#.#.....#.#.....#.........#.....#.#.#.....#.#.#...# - #####.#######.#####.###.#.###.#####.#.#####.#.#####.#.###.#.#######.#.#.#####.###.#.###.###.#########.###.###.#.###.# - #.......#.....#...#...#.#...#.#...#.#.....#.....#.#.....#.#...#.....#.#.#.#.#.#.#.#...#.#...#...#.......#.....#.#.#.# - #.###.###.#.#.###.#.#####.#.###.#####.#.###.#.#.#.#.#.#####.#####.###.###.#.###.###.#.#####.###.#.###.###.###.#.#.#.# - #...#...#.#.#.#.....#.#...#.#.#...#...#...#.#.#.#...#...#.#.....#...#.#.#...#.......#...#.....#...#...#...#...#.....# - #.#########.#####.#.#.#.#.###.#.#######.#####.#######.###.#.#.###.###.#.###.#######.#.###.#.#.###.###.#####.#######.# - #.....#.......#...#...#.#.#...#...........#.......#.....#...#...#...#.......#.#...#.#.#...#.#.#.#.#.#...#...#.......# - ###.#####.#.###.#.#####.#.###.###.#.#.#.#.###.#.#####.#####.#####.#####.###.#.###.#.#.###.#.###.#.#.#.#.###.###.###.# - #...#.#...#...#.#...#...#.#.#.....#.#.#.#.#...#.#.....#...#.#.......#...#.#...#.#.#.#.#.#.#.....#.#...#.#.#...#...#.# - #.###.###.#.#####.#.#######.#.###.#####.#####.#.#####.###.#.###.###.###.#.#.###.#.#.###.###.#######.#.###.#########.# - #.#.......#...#.#.#.#...#...#.#.#.#.......#...#.#.#.....#.....#...#...#.#.......#...#.#...#.....#.#.#...........#.#.# - #.#.###.#.#####.#.#.###.###.###.#.#.#.#.###.#####.###.###.#.#######.#.#####.#####.#.#.#.#########.###.###.#.#####.### - #.#.#...#.#...#.#.#...#.......#.#.#.#.#...#.....#...#.#.#.#.#.#.#...#...#.....#.#.#.......#.#...#.......#.#.........# - #####.#######.#.#######.###.###.#######.###.#.#####.#.#.###.#.#.###.#.#.###.###.###.#######.#.#####.###.#####.###.#.# - #.......#.........#...#.#.....#...#.#.....#.#.#.......#.#...#.......#.#.#...#...#...............#...#...#.....#...#.# - #####.#####.#.#.#.###.#####.#.#.###.###.#####.#.#######.#.#.#.###.#######.#.###.###.###.#######.#########.###.###.#.# - #.#...#.....#.#.#...#.#.#...#.............#...#.#.......#.#.#...#.#.....#.#.#.....#...#.....#.........#.....#...#.#.# - #.###.###.#########.#.#.#####.###.#.#.###.###.#.#.###.#.#.#####.###.#######.#.###.#.###.#.#.###.#####.###.#.#####.#.# - #.......#.#.................#.#.#.#.#.#...#...#.#.#.#.#.#...#.#.....#.#.....#.#.#.#...#.#.#...#...#...#...#.....#.#.# - ###.#.###.###########.###.#####.#.#########.###.#.#.#.###.###.#####.#.#.###.#.#.#.#.#######.#.#############.#.####### - #.#.#...#.#.#.#...#.....#.#.............#.....#...#.#.#.....#.....#...#.#.#.#.#.#.......#.#.#.#.#.....#...#.#.......# - #.#########.#.#.#########.#.#####.#######.#.#.#######.#####.#.###.#.###.#.#.#.#.#.###.###.#####.###.###.#####.#.#.### - #.#.......#.....#.#.............#.....#...#.#.#.#...#.#.#...#...#...#...#.#.#.#.#...#.....#.#.............#.#.#.#...# - #.#######.#####.#.###.#####.#####.###########.#.#.###.#.###.###.#########.#.#.###.#.#.#####.#.#.#.###.#.###.###.#.#.# - #.#.......#.#.........#.#...#...#.#.#.#.....#.#.......#.....#.#...#.#.......#...#.#.#.........#.#...#.#.......#.#.#.# - #.#####.###.###.#.#.###.#.#####.#.#.#.###.###.#.#.###.#.#.#.#.#.###.###.###.#.#####.#.#.#.#.#.#####.#############.### - #...............#.#.#.....#.........#.........#.#.#...#.#.#.#.........#...#.#.....#.#.#.#.#.#.#.................#...# - ###################################.#####.#####.###########.###.###.#####.###.####################################### - G H W U A X L G - Y B H C A I M C diff --git a/input/day21.in b/input/day21.in deleted file mode 100644 index 48e194e..0000000 --- a/input/day21.in +++ /dev/null @@ -1 +0,0 @@ -109,2050,21102,966,1,1,21101,13,0,0,1106,0,1378,21102,20,1,0,1106,0,1337,21102,1,27,0,1105,1,1279,1208,1,65,748,1005,748,73,1208,1,79,748,1005,748,110,1208,1,78,748,1005,748,132,1208,1,87,748,1005,748,169,1208,1,82,748,1005,748,239,21101,0,1041,1,21101,0,73,0,1106,0,1421,21102,78,1,1,21102,1041,1,2,21101,0,88,0,1106,0,1301,21102,68,1,1,21101,0,1041,2,21101,0,103,0,1106,0,1301,1102,1,1,750,1106,0,298,21101,0,82,1,21101,1041,0,2,21101,125,0,0,1105,1,1301,1101,0,2,750,1106,0,298,21101,0,79,1,21101,0,1041,2,21102,1,147,0,1106,0,1301,21102,84,1,1,21102,1,1041,2,21101,162,0,0,1105,1,1301,1101,0,3,750,1105,1,298,21102,65,1,1,21102,1,1041,2,21101,0,184,0,1105,1,1301,21102,1,76,1,21101,0,1041,2,21102,199,1,0,1106,0,1301,21101,0,75,1,21102,1,1041,2,21102,1,214,0,1106,0,1301,21102,1,221,0,1106,0,1337,21101,10,0,1,21101,0,1041,2,21101,236,0,0,1105,1,1301,1105,1,553,21102,1,85,1,21102,1,1041,2,21101,0,254,0,1106,0,1301,21102,1,78,1,21102,1041,1,2,21101,269,0,0,1105,1,1301,21102,1,276,0,1105,1,1337,21101,0,10,1,21102,1041,1,2,21101,291,0,0,1105,1,1301,1102,1,1,755,1106,0,553,21101,32,0,1,21101,1041,0,2,21102,1,313,0,1105,1,1301,21102,320,1,0,1106,0,1337,21101,0,327,0,1105,1,1279,2101,0,1,749,21101,0,65,2,21102,73,1,3,21102,346,1,0,1105,1,1889,1206,1,367,1007,749,69,748,1005,748,360,1102,1,1,756,1001,749,-64,751,1106,0,406,1008,749,74,748,1006,748,381,1102,1,-1,751,1106,0,406,1008,749,84,748,1006,748,395,1101,0,-2,751,1106,0,406,21101,0,1100,1,21101,0,406,0,1105,1,1421,21102,1,32,1,21102,1100,1,2,21101,0,421,0,1106,0,1301,21102,1,428,0,1105,1,1337,21102,435,1,0,1105,1,1279,2102,1,1,749,1008,749,74,748,1006,748,453,1102,-1,1,752,1105,1,478,1008,749,84,748,1006,748,467,1101,-2,0,752,1105,1,478,21101,1168,0,1,21101,478,0,0,1105,1,1421,21101,0,485,0,1105,1,1337,21101,10,0,1,21101,0,1168,2,21102,500,1,0,1106,0,1301,1007,920,15,748,1005,748,518,21101,1209,0,1,21101,518,0,0,1105,1,1421,1002,920,3,529,1001,529,921,529,1002,750,1,0,1001,529,1,537,1001,751,0,0,1001,537,1,545,102,1,752,0,1001,920,1,920,1106,0,13,1005,755,577,1006,756,570,21101,0,1100,1,21101,0,570,0,1105,1,1421,21102,1,987,1,1106,0,581,21101,0,1001,1,21102,588,1,0,1106,0,1378,1101,758,0,593,1002,0,1,753,1006,753,654,21002,753,1,1,21102,610,1,0,1105,1,667,21102,1,0,1,21101,621,0,0,1106,0,1463,1205,1,647,21102,1015,1,1,21102,1,635,0,1106,0,1378,21102,1,1,1,21102,646,1,0,1105,1,1463,99,1001,593,1,593,1105,1,592,1006,755,664,1101,0,0,755,1105,1,647,4,754,99,109,2,1101,0,726,757,22102,1,-1,1,21101,0,9,2,21102,1,697,3,21102,692,1,0,1105,1,1913,109,-2,2106,0,0,109,2,101,0,757,706,2101,0,-1,0,1001,757,1,757,109,-2,2106,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,255,63,191,95,223,159,127,0,205,43,234,238,143,157,119,124,170,200,171,249,217,158,189,39,155,167,98,182,247,197,60,204,123,62,71,178,241,183,252,221,38,76,185,199,175,203,218,141,198,246,163,172,253,137,86,99,125,233,59,231,248,166,153,55,78,201,222,244,139,220,77,168,113,121,242,254,169,138,120,56,108,245,57,213,219,122,251,156,239,173,152,162,188,58,142,34,111,107,118,184,79,93,230,102,226,53,232,35,214,228,177,136,115,140,47,190,206,154,54,250,216,196,61,51,103,237,179,42,46,69,116,49,106,212,187,114,174,229,85,207,202,236,50,100,181,215,243,87,227,68,94,84,235,70,109,92,117,110,126,101,186,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,73,110,112,117,116,32,105,110,115,116,114,117,99,116,105,111,110,115,58,10,13,10,87,97,108,107,105,110,103,46,46,46,10,10,13,10,82,117,110,110,105,110,103,46,46,46,10,10,25,10,68,105,100,110,39,116,32,109,97,107,101,32,105,116,32,97,99,114,111,115,115,58,10,10,58,73,110,118,97,108,105,100,32,111,112,101,114,97,116,105,111,110,59,32,101,120,112,101,99,116,101,100,32,115,111,109,101,116,104,105,110,103,32,108,105,107,101,32,65,78,68,44,32,79,82,44,32,111,114,32,78,79,84,67,73,110,118,97,108,105,100,32,102,105,114,115,116,32,97,114,103,117,109,101,110,116,59,32,101,120,112,101,99,116,101,100,32,115,111,109,101,116,104,105,110,103,32,108,105,107,101,32,65,44,32,66,44,32,67,44,32,68,44,32,74,44,32,111,114,32,84,40,73,110,118,97,108,105,100,32,115,101,99,111,110,100,32,97,114,103,117,109,101,110,116,59,32,101,120,112,101,99,116,101,100,32,74,32,111,114,32,84,52,79,117,116,32,111,102,32,109,101,109,111,114,121,59,32,97,116,32,109,111,115,116,32,49,53,32,105,110,115,116,114,117,99,116,105,111,110,115,32,99,97,110,32,98,101,32,115,116,111,114,101,100,0,109,1,1005,1262,1270,3,1262,20102,1,1262,0,109,-1,2105,1,0,109,1,21101,1288,0,0,1105,1,1263,21002,1262,1,0,1102,1,0,1262,109,-1,2106,0,0,109,5,21101,0,1310,0,1105,1,1279,21201,1,0,-2,22208,-2,-4,-1,1205,-1,1332,21202,-3,1,1,21102,1,1332,0,1106,0,1421,109,-5,2105,1,0,109,2,21102,1,1346,0,1106,0,1263,21208,1,32,-1,1205,-1,1363,21208,1,9,-1,1205,-1,1363,1105,1,1373,21101,0,1370,0,1106,0,1279,1106,0,1339,109,-2,2105,1,0,109,5,1201,-4,0,1386,20102,1,0,-2,22101,1,-4,-4,21102,0,1,-3,22208,-3,-2,-1,1205,-1,1416,2201,-4,-3,1408,4,0,21201,-3,1,-3,1106,0,1396,109,-5,2105,1,0,109,2,104,10,21201,-1,0,1,21101,1436,0,0,1106,0,1378,104,10,99,109,-2,2106,0,0,109,3,20002,593,753,-1,22202,-1,-2,-1,201,-1,754,754,109,-3,2106,0,0,109,10,21102,5,1,-5,21101,1,0,-4,21101,0,0,-3,1206,-9,1555,21101,0,3,-6,21101,0,5,-7,22208,-7,-5,-8,1206,-8,1507,22208,-6,-4,-8,1206,-8,1507,104,64,1105,1,1529,1205,-6,1527,1201,-7,716,1515,21002,0,-11,-8,21201,-8,46,-8,204,-8,1106,0,1529,104,46,21201,-7,1,-7,21207,-7,22,-8,1205,-8,1488,104,10,21201,-6,-1,-6,21207,-6,0,-8,1206,-8,1484,104,10,21207,-4,1,-8,1206,-8,1569,21101,0,0,-9,1105,1,1689,21208,-5,21,-8,1206,-8,1583,21101,0,1,-9,1105,1,1689,1201,-5,716,1589,20101,0,0,-2,21208,-4,1,-1,22202,-2,-1,-1,1205,-2,1613,22101,0,-5,1,21102,1613,1,0,1106,0,1444,1206,-1,1634,22102,1,-5,1,21101,0,1627,0,1106,0,1694,1206,1,1634,21102,1,2,-3,22107,1,-4,-8,22201,-1,-8,-8,1206,-8,1649,21201,-5,1,-5,1206,-3,1663,21201,-3,-1,-3,21201,-4,1,-4,1106,0,1667,21201,-4,-1,-4,21208,-4,0,-1,1201,-5,716,1676,22002,0,-1,-1,1206,-1,1686,21101,1,0,-4,1105,1,1477,109,-10,2106,0,0,109,11,21102,1,0,-6,21102,1,0,-8,21101,0,0,-7,20208,-6,920,-9,1205,-9,1880,21202,-6,3,-9,1201,-9,921,1724,21002,0,1,-5,1001,1724,1,1732,21002,0,1,-4,22101,0,-4,1,21101,0,1,2,21101,9,0,3,21101,0,1754,0,1106,0,1889,1206,1,1772,2201,-10,-4,1766,1001,1766,716,1766,21001,0,0,-3,1105,1,1790,21208,-4,-1,-9,1206,-9,1786,21202,-8,1,-3,1105,1,1790,21202,-7,1,-3,1001,1732,1,1796,20101,0,0,-2,21208,-2,-1,-9,1206,-9,1812,22102,1,-8,-1,1106,0,1816,22101,0,-7,-1,21208,-5,1,-9,1205,-9,1837,21208,-5,2,-9,1205,-9,1844,21208,-3,0,-1,1106,0,1855,22202,-3,-1,-1,1106,0,1855,22201,-3,-1,-1,22107,0,-1,-1,1105,1,1855,21208,-2,-1,-9,1206,-9,1869,22102,1,-1,-8,1105,1,1873,22102,1,-1,-7,21201,-6,1,-6,1106,0,1708,22101,0,-8,-10,109,-11,2105,1,0,109,7,22207,-6,-5,-3,22207,-4,-6,-2,22201,-3,-2,-1,21208,-1,0,-6,109,-7,2106,0,0,0,109,5,2101,0,-2,1912,21207,-4,0,-1,1206,-1,1930,21102,0,1,-4,22101,0,-4,1,21201,-3,0,2,21102,1,1,3,21101,0,1949,0,1105,1,1954,109,-5,2105,1,0,109,6,21207,-4,1,-1,1206,-1,1977,22207,-5,-3,-1,1206,-1,1977,22101,0,-5,-5,1106,0,2045,22101,0,-5,1,21201,-4,-1,2,21202,-3,2,3,21102,1,1996,0,1106,0,1954,22102,1,1,-5,21101,0,1,-2,22207,-5,-3,-1,1206,-1,2015,21102,0,1,-2,22202,-3,-2,-3,22107,0,-4,-1,1206,-1,2037,22101,0,-2,1,21102,2037,1,0,105,1,1912,21202,-3,-1,-3,22201,-5,-3,-5,109,-6,2105,1,0 diff --git a/input/day22.in b/input/day22.in deleted file mode 100644 index f7a54bc..0000000 --- a/input/day22.in +++ /dev/null @@ -1,100 +0,0 @@ -deal with increment 30 -cut 6056 -deal into new stack -deal with increment 13 -cut 495 -deal with increment 58 -deal into new stack -deal with increment 21 -cut 8823 -deal with increment 59 -cut -9853 -deal with increment 65 -deal into new stack -cut -6597 -deal with increment 59 -cut 9239 -deal with increment 4 -deal into new stack -deal with increment 4 -cut 8557 -deal with increment 8 -cut 115 -deal with increment 22 -cut 2088 -deal with increment 65 -deal into new stack -cut 8009 -deal into new stack -cut -7132 -deal with increment 59 -cut 9091 -deal into new stack -deal with increment 46 -cut -5059 -deal into new stack -deal with increment 30 -cut -1320 -deal into new stack -deal with increment 60 -deal into new stack -cut -7889 -deal with increment 60 -deal into new stack -cut -5595 -deal with increment 63 -cut -2711 -deal with increment 34 -cut 6140 -deal into new stack -cut 7103 -deal with increment 15 -cut -8216 -deal with increment 61 -cut -8159 -deal with increment 19 -cut 7942 -deal with increment 10 -cut -1116 -deal with increment 16 -cut -2714 -deal into new stack -deal with increment 70 -cut -7959 -deal with increment 40 -cut 6906 -deal into new stack -deal with increment 65 -cut 8120 -deal with increment 70 -cut -7770 -deal with increment 12 -cut -6563 -deal with increment 62 -cut 9205 -deal with increment 17 -cut 1949 -deal with increment 72 -cut -5249 -deal with increment 6 -cut 948 -deal into new stack -cut 1155 -deal into new stack -deal with increment 26 -cut 5856 -deal with increment 18 -cut -7873 -deal with increment 4 -cut -7413 -deal with increment 18 -cut -7559 -deal with increment 21 -cut -2338 -deal with increment 16 -deal into new stack -cut 9644 -deal with increment 16 -cut -7319 -deal with increment 34 -cut -7603 diff --git a/input/day23.in b/input/day23.in deleted file mode 100644 index 67fd867..0000000 --- a/input/day23.in +++ /dev/null @@ -1 +0,0 @@ -3,62,1001,62,11,10,109,2267,105,1,0,1590,1977,876,1120,1188,2230,641,1155,1559,936,1847,2189,2117,1029,674,1917,1363,610,1695,1880,2049,1814,1493,1258,705,810,967,905,845,1662,2014,1394,1089,1631,2150,1427,1332,1524,1291,2080,1460,1730,1948,571,1221,742,1060,777,1761,998,0,0,0,0,0,0,0,0,0,0,0,0,3,64,1008,64,-1,62,1006,62,88,1006,61,170,1106,0,73,3,65,21001,64,0,1,21001,66,0,2,21101,0,105,0,1105,1,436,1201,1,-1,64,1007,64,0,62,1005,62,73,7,64,67,62,1006,62,73,1002,64,2,133,1,133,68,133,102,1,0,62,1001,133,1,140,8,0,65,63,2,63,62,62,1005,62,73,1002,64,2,161,1,161,68,161,1102,1,1,0,1001,161,1,169,102,1,65,0,1102,1,1,61,1102,1,0,63,7,63,67,62,1006,62,203,1002,63,2,194,1,68,194,194,1006,0,73,1001,63,1,63,1105,1,178,21102,1,210,0,106,0,69,2102,1,1,70,1101,0,0,63,7,63,71,62,1006,62,250,1002,63,2,234,1,72,234,234,4,0,101,1,234,240,4,0,4,70,1001,63,1,63,1105,1,218,1105,1,73,109,4,21102,0,1,-3,21102,0,1,-2,20207,-2,67,-1,1206,-1,293,1202,-2,2,283,101,1,283,283,1,68,283,283,22001,0,-3,-3,21201,-2,1,-2,1106,0,263,21202,-3,1,-3,109,-4,2105,1,0,109,4,21101,1,0,-3,21102,0,1,-2,20207,-2,67,-1,1206,-1,342,1202,-2,2,332,101,1,332,332,1,68,332,332,22002,0,-3,-3,21201,-2,1,-2,1105,1,312,21201,-3,0,-3,109,-4,2105,1,0,109,1,101,1,68,359,20102,1,0,1,101,3,68,366,21002,0,1,2,21102,1,376,0,1105,1,436,21202,1,1,0,109,-1,2106,0,0,1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288,1048576,2097152,4194304,8388608,16777216,33554432,67108864,134217728,268435456,536870912,1073741824,2147483648,4294967296,8589934592,17179869184,34359738368,68719476736,137438953472,274877906944,549755813888,1099511627776,2199023255552,4398046511104,8796093022208,17592186044416,35184372088832,70368744177664,140737488355328,281474976710656,562949953421312,1125899906842624,109,8,21202,-6,10,-5,22207,-7,-5,-5,1205,-5,521,21101,0,0,-4,21101,0,0,-3,21102,51,1,-2,21201,-2,-1,-2,1201,-2,385,470,21001,0,0,-1,21202,-3,2,-3,22207,-7,-1,-5,1205,-5,496,21201,-3,1,-3,22102,-1,-1,-5,22201,-7,-5,-7,22207,-3,-6,-5,1205,-5,515,22102,-1,-6,-5,22201,-3,-5,-3,22201,-1,-4,-4,1205,-2,461,1106,0,547,21101,-1,0,-4,21202,-6,-1,-6,21207,-7,0,-5,1205,-5,547,22201,-7,-6,-7,21201,-4,1,-4,1105,1,529,21201,-4,0,-7,109,-8,2106,0,0,109,1,101,1,68,564,20101,0,0,0,109,-1,2106,0,0,1101,0,96059,66,1102,1,5,67,1101,0,598,68,1101,0,302,69,1101,0,1,71,1101,608,0,72,1106,0,73,0,0,0,0,0,0,0,0,0,0,29,96377,1102,1,25589,66,1102,1,1,67,1101,637,0,68,1102,556,1,69,1102,1,1,71,1102,639,1,72,1105,1,73,1,-11,11,381354,1101,0,38861,66,1102,1,2,67,1102,1,668,68,1101,302,0,69,1102,1,1,71,1102,672,1,72,1105,1,73,0,0,0,0,21,40063,1102,10091,1,66,1102,1,1,67,1102,1,701,68,1101,556,0,69,1102,1,1,71,1102,703,1,72,1105,1,73,1,41,5,14897,1101,69697,0,66,1101,4,0,67,1101,732,0,68,1102,253,1,69,1101,1,0,71,1101,0,740,72,1105,1,73,0,0,0,0,0,0,0,0,7,24281,1102,1,72893,66,1101,0,1,67,1102,1,769,68,1102,556,1,69,1101,0,3,71,1101,771,0,72,1105,1,73,1,13,44,248277,11,190677,19,15556,1101,66851,0,66,1101,2,0,67,1101,804,0,68,1102,302,1,69,1101,0,1,71,1102,1,808,72,1106,0,73,0,0,0,0,34,409468,1102,46681,1,66,1101,0,1,67,1102,837,1,68,1101,0,556,69,1102,3,1,71,1102,1,839,72,1105,1,73,1,5,39,57487,39,114974,38,95138,1101,7883,0,66,1102,1,1,67,1101,872,0,68,1101,0,556,69,1102,1,1,71,1102,874,1,72,1105,1,73,1,677,43,192118,1102,1,84089,66,1101,0,1,67,1101,0,903,68,1102,1,556,69,1102,0,1,71,1102,1,905,72,1106,0,73,1,1634,1101,20297,0,66,1102,1,1,67,1101,0,932,68,1102,1,556,69,1102,1,1,71,1101,934,0,72,1106,0,73,1,967,3,23362,1102,1,95597,66,1102,1,1,67,1102,1,963,68,1102,556,1,69,1102,1,1,71,1102,1,965,72,1106,0,73,1,-231,19,11667,1101,45181,0,66,1102,1,1,67,1101,994,0,68,1102,1,556,69,1101,0,1,71,1101,996,0,72,1105,1,73,1,125,39,172461,1102,19087,1,66,1102,1,1,67,1101,0,1025,68,1102,556,1,69,1101,1,0,71,1101,1027,0,72,1106,0,73,1,51,30,103991,1102,56093,1,66,1102,1,1,67,1102,1056,1,68,1101,0,556,69,1101,1,0,71,1102,1,1058,72,1105,1,73,1,10181,12,18061,1102,69857,1,66,1102,1,1,67,1102,1,1087,68,1101,0,556,69,1101,0,0,71,1101,1089,0,72,1105,1,73,1,1387,1101,53881,0,66,1101,1,0,67,1101,1116,0,68,1102,556,1,69,1102,1,1,71,1102,1,1118,72,1106,0,73,1,37,43,288177,1102,1,11681,66,1101,3,0,67,1102,1147,1,68,1102,1,302,69,1101,0,1,71,1102,1,1153,72,1105,1,73,0,0,0,0,0,0,34,307101,1102,1,24281,66,1102,1,2,67,1102,1,1182,68,1102,351,1,69,1101,1,0,71,1101,1186,0,72,1105,1,73,0,0,0,0,255,65183,1102,1,1093,66,1101,2,0,67,1102,1,1215,68,1101,302,0,69,1102,1,1,71,1101,0,1219,72,1105,1,73,0,0,0,0,31,24671,1102,82759,1,66,1102,4,1,67,1102,1,1248,68,1101,0,302,69,1101,1,0,71,1102,1,1256,72,1106,0,73,0,0,0,0,0,0,0,0,34,204734,1101,100279,0,66,1102,1,1,67,1101,1285,0,68,1102,556,1,69,1102,2,1,71,1101,0,1287,72,1105,1,73,1,2,38,190276,38,237845,1102,1,47569,66,1101,0,6,67,1101,0,1318,68,1102,1,302,69,1102,1,1,71,1102,1330,1,72,1105,1,73,0,0,0,0,0,0,0,0,0,0,0,0,7,48562,1102,13163,1,66,1101,0,1,67,1102,1359,1,68,1101,556,0,69,1102,1,1,71,1102,1361,1,72,1106,0,73,1,293,5,44691,1102,1,101287,66,1102,1,1,67,1102,1,1390,68,1101,0,556,69,1101,0,1,71,1102,1392,1,72,1106,0,73,1,97,11,317795,1101,24671,0,66,1101,0,2,67,1102,1,1421,68,1101,0,302,69,1102,1,1,71,1102,1425,1,72,1105,1,73,0,0,0,0,47,133702,1102,77687,1,66,1101,2,0,67,1102,1,1454,68,1102,1,302,69,1102,1,1,71,1102,1,1458,72,1106,0,73,0,0,0,0,43,384236,1102,78367,1,66,1102,1,1,67,1101,1487,0,68,1101,0,556,69,1101,2,0,71,1101,0,1489,72,1106,0,73,1,10,39,229948,38,47569,1102,1,3061,66,1101,1,0,67,1101,1520,0,68,1102,556,1,69,1101,0,1,71,1101,1522,0,72,1105,1,73,1,523,30,207982,1101,33181,0,66,1102,3,1,67,1101,1551,0,68,1101,0,302,69,1101,0,1,71,1101,1557,0,72,1106,0,73,0,0,0,0,0,0,24,278788,1101,102181,0,66,1101,1,0,67,1102,1586,1,68,1101,0,556,69,1101,1,0,71,1102,1588,1,72,1106,0,73,1,378,44,165518,1101,65183,0,66,1101,0,1,67,1102,1617,1,68,1102,556,1,69,1101,0,6,71,1101,0,1619,72,1106,0,73,1,25255,29,192754,18,141326,18,211989,37,33181,37,66362,37,99543,1101,88799,0,66,1102,1,1,67,1102,1,1658,68,1101,556,0,69,1101,0,1,71,1101,1660,0,72,1106,0,73,1,160,38,285414,1102,96377,1,66,1102,1,2,67,1101,1689,0,68,1102,1,302,69,1101,0,1,71,1102,1,1693,72,1106,0,73,0,0,0,0,24,139394,1101,70663,0,66,1102,3,1,67,1101,0,1722,68,1101,0,302,69,1102,1,1,71,1102,1728,1,72,1106,0,73,0,0,0,0,0,0,24,209091,1102,104173,1,66,1101,1,0,67,1101,0,1757,68,1101,556,0,69,1102,1,1,71,1101,1759,0,72,1106,0,73,1,31,44,82759,1101,92951,0,66,1102,1,1,67,1101,0,1788,68,1101,556,0,69,1101,0,12,71,1102,1,1790,72,1106,0,73,1,1,44,331036,30,311973,4,2186,31,49342,47,66851,3,11681,12,36122,6,77722,21,80126,35,155374,43,480295,19,7778,1102,40063,1,66,1102,2,1,67,1101,0,1841,68,1101,302,0,69,1102,1,1,71,1102,1,1845,72,1106,0,73,0,0,0,0,35,77687,1102,1,74377,66,1101,1,0,67,1101,0,1874,68,1102,1,556,69,1101,2,0,71,1101,1876,0,72,1105,1,73,1,19,11,127118,19,3889,1102,3889,1,66,1102,4,1,67,1102,1,1907,68,1102,302,1,69,1102,1,1,71,1101,1915,0,72,1106,0,73,0,0,0,0,0,0,0,0,18,70663,1102,1,8353,66,1102,1,1,67,1102,1944,1,68,1101,0,556,69,1101,0,1,71,1101,0,1946,72,1106,0,73,1,-52,3,35043,1101,0,31477,66,1101,0,1,67,1102,1,1975,68,1101,0,556,69,1101,0,0,71,1102,1977,1,72,1106,0,73,1,1229,1102,32159,1,66,1102,1,1,67,1101,2004,0,68,1102,556,1,69,1101,4,0,71,1102,1,2006,72,1105,1,73,1,7,5,29794,5,59588,11,63559,43,96059,1101,0,103991,66,1102,1,3,67,1101,2041,0,68,1102,302,1,69,1101,0,1,71,1102,2047,1,72,1106,0,73,0,0,0,0,0,0,34,511835,1101,0,78157,66,1101,1,0,67,1102,2076,1,68,1102,556,1,69,1101,1,0,71,1102,2078,1,72,1106,0,73,1,-81047,4,1093,1102,57487,1,66,1101,0,4,67,1101,0,2107,68,1102,1,302,69,1101,0,1,71,1102,2115,1,72,1106,0,73,0,0,0,0,0,0,0,0,38,142707,1102,18061,1,66,1101,0,2,67,1102,2144,1,68,1102,302,1,69,1101,1,0,71,1102,1,2148,72,1105,1,73,0,0,0,0,6,38861,1102,102367,1,66,1102,5,1,67,1101,0,2177,68,1102,253,1,69,1101,1,0,71,1102,1,2187,72,1105,1,73,0,0,0,0,0,0,0,0,0,0,11,254236,1102,1,63559,66,1101,6,0,67,1102,1,2216,68,1102,1,302,69,1102,1,1,71,1102,2228,1,72,1106,0,73,0,0,0,0,0,0,0,0,0,0,0,0,24,69697,1102,14897,1,66,1101,0,4,67,1101,2257,0,68,1101,0,302,69,1101,0,1,71,1102,2265,1,72,1106,0,73,0,0,0,0,0,0,0,0,34,102367 diff --git a/input/day24.in b/input/day24.in deleted file mode 100644 index 5126c4f..0000000 --- a/input/day24.in +++ /dev/null @@ -1,5 +0,0 @@ -##.#. -##.#. -##.## -.#### -.#... diff --git a/input/day25.in b/input/day25.in deleted file mode 100644 index b060a82..0000000 --- a/input/day25.in +++ /dev/null @@ -1 +0,0 @@ -109,4779,21101,3124,0,1,21102,1,13,0,1105,1,1424,21102,166,1,1,21101,0,24,0,1105,1,1234,21101,31,0,0,1105,1,1984,1105,1,13,6,4,3,2,52,51,21,4,28,56,55,3,19,-9,-10,47,89,88,90,90,6,77,73,85,71,1,76,68,63,65,22,-27,70,76,81,87,5,105,105,107,108,95,4,97,92,109,109,5,110,105,110,108,95,4,115,96,109,109,13,-3,59,101,85,92,97,13,84,80,92,78,34,-15,26,-16,46,88,72,79,84,0,72,76,-3,85,74,79,75,-8,64,68,75,57,65,70,64,66,72,8,-41,32,-22,56,77,82,-4,60,76,62,70,-2,74,-11,55,52,68,67,73,56,60,52,-20,44,56,66,-24,48,58,42,49,54,-16,-53,10,0,56,99,96,95,82,94,83,45,-9,23,-13,61,85,88,74,71,82,73,79,73,89,67,65,-4,62,73,70,69,56,68,57,2,-35,24,-14,64,85,90,4,70,67,79,7,83,-2,68,75,-5,78,65,57,75,-10,76,53,76,0,-37,31,-21,57,78,83,-3,64,74,72,0,76,-9,73,58,57,-13,70,57,49,67,-18,54,64,48,55,-23,48,44,56,42,-14,-51,14,-4,74,95,100,14,97,77,86,79,9,92,79,75,5,27,-17,61,82,87,1,68,78,76,4,80,-5,66,58,78,60,-10,73,60,52,70,-15,57,67,51,58,-6,-43,14,-4,74,95,100,14,81,94,90,90,9,92,79,75,5,60,-50,23,42,38,-32,38,39,30,42,47,-38,30,36,28,25,41,38,34,31,18,23,29,19,33,-52,20,29,-55,27,27,27,8,15,-61,22,16,-64,24,13,18,-54,-69,-70,-14,7,12,-74,-8,-11,1,-71,5,-80,-4,-3,3,-15,-84,-85,-109,29,-19,59,80,85,-1,82,62,71,64,-6,77,64,60,-10,62,66,57,59,63,57,67,51,-19,56,58,57,57,-10,-47,44,-34,39,58,54,-16,60,61,57,64,48,56,-23,52,40,60,38,-28,44,53,-31,55,32,55,-35,48,42,41,-39,32,38,42,-42,-44,12,33,38,-48,28,19,25,32,-52,-76,-77,59,-49,13,55,-30,42,51,-33,49,50,32,31,31,39,36,48,-42,24,35,32,34,29,21,35,19,25,37,-53,14,10,26,18,-57,-59,-3,18,23,-63,1,17,3,-67,1,-4,14,-2,6,-73,-8,14,-76,-12,-78,-40,2,4,-13,-82,-106,-107,35,-25,53,74,79,0,74,60,-10,65,53,72,64,52,56,52,50,-19,53,57,62,56,-24,58,54,38,39,40,-29,-31,2,56,35,-34,-58,-59,138,-128,-74,-108,-33,-31,-26,-44,-101,-114,-33,-37,-51,-39,-35,-47,-54,-122,-37,-45,-52,-59,-58,-128,-46,-65,-42,-49,-133,-132,-102,-60,-68,-56,-55,-139,-141,-106,-61,-65,-72,-78,-64,-148,-70,-72,-151,-68,-81,-81,-72,-156,-74,-86,-86,-80,-161,-97,-81,-95,-165,-94,-98,-103,-83,-97,-102,-90,-173,-90,-103,-111,-99,-178,-95,-108,-112,-182,-115,-115,-101,-117,-120,-104,-120,-122,-191,-106,-128,-118,-110,-127,-196,-196,-199,-135,-123,-134,-203,-115,-126,-121,-207,-143,-127,-141,-211,-143,-139,-145,-148,-132,-148,-150,-219,-154,-156,-155,-148,-224,-141,-147,-227,-144,-157,-161,-231,-165,-161,-165,-168,-161,-157,-159,-166,-162,-157,-228,-265,138,-128,-74,-108,-33,-31,-26,-44,-101,-114,-33,-37,-51,-39,-35,-47,-54,-122,-37,-45,-52,-59,-58,-128,-46,-65,-42,-49,-133,-132,-102,-60,-68,-56,-55,-139,-141,-106,-61,-65,-72,-78,-64,-148,-70,-72,-151,-68,-81,-81,-72,-156,-74,-86,-86,-80,-161,-97,-81,-95,-165,-90,-94,-97,-97,-86,-102,-90,-173,-90,-103,-111,-99,-178,-95,-108,-112,-182,-115,-115,-101,-117,-120,-104,-120,-122,-191,-106,-128,-118,-110,-127,-196,-196,-199,-135,-123,-134,-203,-115,-126,-121,-207,-143,-127,-141,-211,-143,-139,-145,-148,-132,-148,-150,-219,-154,-156,-155,-148,-224,-141,-147,-227,-144,-157,-161,-231,-165,-161,-165,-168,-161,-157,-159,-166,-162,-157,-228,-265,263,-253,-199,-233,-158,-156,-151,-169,-226,-239,-158,-162,-176,-164,-160,-172,-179,-247,-162,-170,-177,-184,-183,-253,-171,-190,-167,-174,-258,-257,-227,-183,-197,-187,-175,-182,-193,-184,-268,-202,-191,-194,-192,-197,-205,-191,-207,-276,-278,-222,-201,-196,-282,-206,-219,-196,-286,-207,-206,-210,-223,-222,-223,-225,-280,-293,-296,-232,-220,-231,-300,-212,-223,-218,-304,-236,-228,-223,-239,-227,-310,-227,-240,-244,-314,-248,-237,-250,-243,-239,-247,-237,-308,-345,-273,-260,-248,-243,-263,-329,-252,-252,-248,-260,-267,-266,-253,-337,-249,-260,-255,-259,-342,-260,-267,-280,-270,-271,-348,-281,-268,-272,-279,-285,-342,-355,-280,-278,-279,-284,-277,-361,-282,-278,-274,-275,-290,-298,-300,-369,-300,-292,-290,-373,-309,-375,-299,-298,-301,-310,-302,-297,-370,-383,-302,-316,-321,-311,-315,-299,-321,-308,-392,-306,-322,-330,-312,-397,-326,-334,-317,-401,-330,-338,-324,-325,-337,-329,-339,-341,-398,-411,-347,-335,-346,-415,-334,-352,-350,-346,-341,-338,-422,-334,-345,-340,-344,-427,-345,-357,-357,-351,-432,-365,-361,-353,-367,-370,-354,-363,-351,-427,-464,-441,-397,-373,-434,-447,-376,-380,-374,-375,-373,-452,-454,-398,-377,-372,-458,-376,-388,-382,-377,-387,-396,-465,-400,-398,-468,-404,-404,-395,-403,-473,-390,-396,-476,-406,-409,-395,-480,-408,-404,-483,-418,-396,-486,-403,-399,-409,-417,-413,-421,-493,37,-5,73,71,-8,75,62,58,-12,62,55,74,64,48,50,-19,45,63,-22,61,48,44,-26,50,37,44,48,-31,33,40,48,41,43,30,37,-25,-38,-63,0,0,109,7,21101,0,0,-2,22208,-2,-5,-1,1205,-1,1169,22202,-2,-4,1,22201,1,-6,1,21201,-2,0,2,21102,1,1162,0,2105,1,-3,21201,-2,1,-2,1105,1,1136,109,-7,2105,1,0,109,6,2102,1,-5,1182,20102,1,0,-2,21102,0,1,-3,21201,-5,1,-5,22208,-3,-2,-1,1205,-1,1229,2201,-5,-3,1205,20102,1,0,1,21201,-3,0,2,22101,0,-2,3,21101,0,1222,0,2106,0,-4,21201,-3,1,-3,1105,1,1192,109,-6,2105,1,0,109,2,21201,-1,0,1,21101,0,1256,2,21101,0,1251,0,1106,0,1174,109,-2,2106,0,0,109,5,22201,-4,-3,-1,22201,-2,-1,-1,204,-1,109,-5,2105,1,0,109,3,2101,0,-2,1280,1006,0,1303,104,45,104,32,1201,-1,66,1292,20101,0,0,1,21102,1301,1,0,1106,0,1234,104,10,109,-3,2105,1,0,0,0,109,2,1201,-1,0,1309,1101,0,0,1308,21101,0,4601,1,21102,1,13,2,21101,4,0,3,21101,0,1353,4,21101,0,1343,0,1106,0,1130,20101,0,1308,-1,109,-2,2106,0,0,96,109,3,1201,-2,0,1360,20008,0,1309,-1,1206,-1,1419,1005,1308,1398,1101,1,0,1308,21008,1309,-1,-1,1206,-1,1387,21102,106,1,1,1106,0,1391,21102,1,92,1,21101,1398,0,0,1105,1,1234,104,45,104,32,1201,-2,1,1407,21002,0,1,1,21102,1,1417,0,1106,0,1234,104,10,109,-3,2105,1,0,109,3,2102,1,-2,1128,21101,34,0,1,21102,1441,1,0,1105,1,1234,1001,1128,0,1447,20101,0,0,1,21101,1456,0,0,1105,1,1234,21101,41,0,1,21101,1467,0,0,1106,0,1234,1001,1128,1,1473,20101,0,0,1,21101,1482,0,0,1105,1,1234,21101,46,0,1,21102,1,1493,0,1106,0,1234,21001,1128,3,1,21101,4,0,2,21102,1,1,3,21101,1273,0,4,21101,1516,0,0,1105,1,1130,21002,1128,1,1,21101,1527,0,0,1105,1,1310,1001,1128,2,1532,21002,0,1,-1,1206,-1,1545,21102,1545,1,0,2106,0,-1,109,-3,2105,1,0,109,0,99,109,2,1102,0,1,1550,21101,4601,0,1,21101,13,0,2,21102,1,4,3,21102,1,1664,4,21101,1582,0,0,1106,0,1130,2,2486,1352,1551,1102,0,1,1552,21001,1550,0,1,21102,1,33,2,21101,0,1702,3,21102,1,1609,0,1105,1,2722,21007,1552,0,-1,1205,-1,1630,20107,0,1552,-1,1205,-1,1637,21102,1630,1,0,1105,1,1752,21101,0,548,1,1105,1,1641,21102,1,687,1,21102,1,1648,0,1105,1,1234,21102,1,4457,1,21102,1,1659,0,1105,1,1424,109,-2,2106,0,0,109,4,21202,-2,-1,-2,1202,-3,1,1675,21008,0,-1,-1,1206,-1,1697,1201,-3,2,1687,20101,-27,0,-3,22201,-3,-2,-3,2001,1550,-3,1550,109,-4,2106,0,0,109,5,21008,1552,0,-1,1206,-1,1747,1201,-3,1901,1717,20101,0,0,-2,1205,-4,1736,20207,-2,1551,-1,1205,-1,1747,1102,-1,1,1552,1106,0,1747,22007,1551,-2,-1,1205,-1,1747,1101,1,0,1552,109,-5,2106,0,0,109,1,21101,0,826,1,21101,1765,0,0,1105,1,1234,21002,1550,1,1,21101,0,1776,0,1105,1,2863,21102,1090,1,1,21101,1787,0,0,1105,1,1234,99,1105,1,1787,109,-1,2105,1,0,109,1,21102,1,512,1,21102,1809,1,0,1105,1,1234,99,1106,0,1809,109,-1,2105,1,0,109,1,1102,1,1,1129,109,-1,2105,1,0,109,1,21102,377,1,1,21101,1842,0,0,1106,0,1234,1106,0,1831,109,-1,2106,0,0,109,1,21102,407,1,1,21101,0,1863,0,1106,0,1234,99,1106,0,1863,109,-1,2105,1,0,109,1,21102,452,1,1,21101,0,1885,0,1106,0,1234,99,1106,0,1885,109,-1,2106,0,0,1941,1947,1953,1958,1965,1972,1978,4760,4557,5066,5021,5217,4700,4887,5216,5186,4670,5148,5088,5222,5161,5049,4612,4644,5135,5028,4603,5069,4734,4513,4819,4558,5025,4593,4652,4643,4576,4719,4992,4725,2281,2468,2418,2450,2487,2125,2505,5,95,108,104,104,23,5,96,91,108,108,1,4,101,105,112,3,6,104,104,106,107,94,-1,6,109,104,109,107,94,-1,5,111,91,100,93,23,5,114,95,108,108,1,109,3,21102,1993,1,0,1105,1,2634,1006,1129,2010,21101,316,0,1,21102,2007,1,0,1105,1,1234,1105,1,2076,21101,0,0,-1,1201,-1,1894,2020,20102,1,0,1,21101,0,0,2,21101,0,0,3,21102,1,2037,0,1105,1,2525,1206,1,2054,1201,-1,1934,2050,21101,0,2051,0,106,0,0,1106,0,2076,21201,-1,1,-1,21207,-1,7,-2,1205,-2,2014,21102,1,177,1,21102,2076,1,0,1106,0,1234,109,-3,2106,0,0,109,3,2001,1128,-2,2089,20102,1,0,-1,1205,-1,2108,21101,201,0,1,21102,2105,1,0,1105,1,1234,1106,0,2119,22102,1,-1,1,21101,0,2119,0,1106,0,1424,109,-3,2106,0,0,0,109,1,1101,0,0,2124,21101,0,4601,1,21101,13,0,2,21101,4,0,3,21102,2173,1,4,21102,1,2154,0,1106,0,1130,1005,2124,2168,21102,226,1,1,21101,0,2168,0,1106,0,1234,109,-1,2105,1,0,109,3,1005,2124,2275,1201,-2,0,2183,20008,0,1128,-1,1206,-1,2275,1201,-2,1,2194,21001,0,0,-1,22102,1,-1,1,21101,5,0,2,21101,1,0,3,21102,1,2216,0,1105,1,2525,1206,1,2275,21101,0,258,1,21102,1,2230,0,1105,1,1234,21201,-1,0,1,21101,0,2241,0,1106,0,1234,104,46,104,10,1101,0,1,2124,1201,-2,0,2256,1101,-1,0,0,1201,-2,3,2262,21002,0,1,-1,1206,-1,2275,21102,1,2275,0,2106,0,-1,109,-3,2106,0,0,0,109,1,1102,0,1,2280,21102,4601,1,1,21101,0,13,2,21102,1,4,3,21102,2329,1,4,21101,0,2310,0,1106,0,1130,1005,2280,2324,21102,1,273,1,21101,0,2324,0,1106,0,1234,109,-1,2105,1,0,109,3,1005,2280,2413,1201,-2,0,2339,21008,0,-1,-1,1206,-1,2413,1201,-2,1,2350,21002,0,1,-1,22102,1,-1,1,21102,1,5,2,21102,1,1,3,21102,2372,1,0,1105,1,2525,1206,1,2413,21102,301,1,1,21101,0,2386,0,1105,1,1234,21201,-1,0,1,21101,2397,0,0,1105,1,1234,104,46,104,10,1101,1,0,2280,1201,-2,0,2412,102,1,1128,0,109,-3,2106,0,0,109,1,21102,-1,1,1,21102,2431,1,0,1106,0,1310,1205,1,2445,21101,133,0,1,21102,1,2445,0,1106,0,1234,109,-1,2105,1,0,109,1,21101,3,0,1,21102,1,2463,0,1105,1,2081,109,-1,2105,1,0,109,1,21102,1,4,1,21102,2481,1,0,1106,0,2081,109,-1,2106,0,0,54,109,1,21102,5,1,1,21102,1,2500,0,1106,0,2081,109,-1,2106,0,0,109,1,21102,1,6,1,21102,1,2518,0,1105,1,2081,109,-1,2105,1,0,0,0,109,5,2101,0,-3,2523,1102,1,1,2524,21202,-4,1,1,21101,0,2585,2,21101,2550,0,0,1105,1,1174,1206,-2,2576,1202,-4,1,2558,2001,0,-3,2566,101,3094,2566,2566,21008,0,-1,-1,1205,-1,2576,1102,0,1,2524,20101,0,2524,-4,109,-5,2106,0,0,109,5,22201,-4,-3,-4,22201,-4,-2,-4,21208,-4,10,-1,1206,-1,2606,21102,1,-1,-4,201,-3,2523,2615,1001,2615,3094,2615,21002,0,1,-1,22208,-4,-1,-1,1205,-1,2629,1102,0,1,2524,109,-5,2105,1,0,109,4,21101,0,3094,1,21102,1,30,2,21102,1,1,3,21101,2706,0,4,21101,0,2659,0,1106,0,1130,21101,0,0,-3,203,-2,21208,-2,10,-1,1205,-1,2701,21207,-2,0,-1,1205,-1,2663,21207,-3,29,-1,1206,-1,2663,2101,3094,-3,2693,1201,-2,0,0,21201,-3,1,-3,1105,1,2663,109,-4,2105,1,0,109,2,1202,-1,1,2715,1102,-1,1,0,109,-2,2105,1,0,0,109,5,2101,0,-2,2721,21207,-4,0,-1,1206,-1,2739,21101,0,0,-4,21201,-4,0,1,22101,0,-3,2,21102,1,1,3,21102,1,2758,0,1106,0,2763,109,-5,2106,0,0,109,6,21207,-4,1,-1,1206,-1,2786,22207,-5,-3,-1,1206,-1,2786,21202,-5,1,-5,1105,1,2858,22102,1,-5,1,21201,-4,-1,2,21202,-3,2,3,21102,2805,1,0,1105,1,2763,21201,1,0,-5,21102,1,1,-2,22207,-5,-3,-1,1206,-1,2824,21101,0,0,-2,22202,-3,-2,-3,22107,0,-4,-1,1206,-1,2850,21201,-2,0,1,21201,-4,-1,2,21101,2850,0,0,105,1,2721,21202,-3,-1,-3,22201,-5,-3,-5,109,-6,2106,0,0,109,3,21208,-2,0,-1,1205,-1,2902,21207,-2,0,-1,1205,-1,2882,1106,0,2888,104,45,21202,-2,-1,-2,21201,-2,0,1,21102,2899,1,0,1105,1,2909,1105,1,2904,104,48,109,-3,2106,0,0,109,4,21202,-3,1,1,21102,10,1,2,21102,2926,1,0,1106,0,3010,21201,1,0,-2,21202,2,1,-1,1206,-2,2948,22101,0,-2,1,21101,0,2948,0,1106,0,2909,22101,48,-1,-1,204,-1,109,-4,2106,0,0,1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288,1048576,2097152,4194304,8388608,16777216,33554432,67108864,134217728,268435456,536870912,1073741824,2147483648,4294967296,8589934592,17179869184,34359738368,68719476736,137438953472,274877906944,549755813888,1099511627776,2199023255552,4398046511104,8796093022208,17592186044416,35184372088832,70368744177664,140737488355328,281474976710656,562949953421312,1125899906842624,109,8,21102,0,1,-4,21102,1,0,-3,21102,1,51,-2,21201,-2,-1,-2,1201,-2,2959,3033,21002,0,1,-1,21202,-3,2,-3,22207,-7,-1,-5,1205,-5,3059,21201,-3,1,-3,22102,-1,-1,-5,22201,-7,-5,-7,22207,-3,-6,-5,1205,-5,3078,22102,-1,-6,-5,22201,-3,-5,-3,22201,-1,-4,-4,1205,-2,3024,22101,0,-4,-7,22101,0,-3,-6,109,-8,2105,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3131,3143,0,3396,3252,0,3619,11,61,105,95,94,17,50,97,83,78,79,83,108,-19,2,7,-79,-9,-2,2,-83,-11,-7,-86,-3,-16,-7,-11,-6,-21,-21,-94,-30,-96,-25,-19,-23,-31,-101,-29,-25,-104,-21,-34,-38,-108,-39,-34,-32,-33,-31,-114,-43,-47,-35,-49,-105,-120,-69,-43,-123,-49,-56,-57,-47,-128,-40,-51,-46,-50,-133,-51,-63,-63,-57,-138,-69,-58,-62,-65,-143,-79,-69,-63,-68,-148,-79,-68,-82,-83,-63,-81,-77,-85,-145,-158,-75,-88,-92,-162,-91,-85,-89,-97,-167,-96,-104,-87,-171,-106,-104,-105,-97,-176,-94,-109,-114,-104,-112,-114,-169,3259,3267,0,0,3316,0,3124,7,76,108,102,104,86,91,88,48,36,55,51,-19,46,58,66,46,59,-25,48,58,55,55,-30,36,47,45,50,30,37,41,-38,38,39,41,27,-43,22,34,42,22,35,-35,-50,-51,-2,16,13,30,26,26,15,27,9,15,27,-49,3323,3335,0,4219,4024,0,3252,11,68,86,102,87,99,102,80,98,92,94,100,60,24,43,39,51,37,-33,31,47,33,-37,27,-39,30,28,45,-43,40,24,30,22,35,18,29,29,17,30,-27,-55,28,15,11,30,-53,21,7,-63,1,11,10,-67,-2,10,6,13,-3,-5,-74,-7,3,10,0,-67,-80,3,-10,-4,1,-14,-14,-73,3403,3412,0,3708,3492,3124,0,8,59,102,104,103,93,87,97,99,79,5,24,20,-50,26,17,31,11,21,-56,30,7,17,16,22,-62,2,14,3,-66,17,4,0,-70,6,-3,11,-9,1,-76,-7,-2,0,-1,1,-82,-18,-2,-16,-86,-4,-12,-16,-19,-19,-8,-17,-5,-95,-28,-24,-28,-29,-31,-19,-33,-25,-20,-105,-39,-28,-32,-30,-28,-28,-98,-113,-67,-33,-116,-52,-36,-50,-120,-37,-50,-54,-35,-94,3499,3508,0,3758,3564,0,3396,8,72,88,105,104,85,90,87,100,55,29,48,44,63,-20,54,40,-30,34,-32,43,39,49,48,39,31,-39,44,46,31,40,40,44,-46,18,30,19,-50,32,32,12,28,29,17,21,13,-59,24,18,-62,13,15,14,9,-67,-3,7,6,-71,-7,3,-1,0,-7,-63,3571,3578,0,3886,0,0,3492,6,59,107,91,88,90,90,40,38,70,68,58,-12,66,56,-15,68,55,51,-19,47,44,44,50,54,44,58,56,-28,54,39,38,45,-33,50,44,-36,35,27,47,29,-41,38,36,43,24,36,-33,3626,3635,0,0,3124,0,3827,8,75,96,89,96,20,53,83,106,72,11,44,38,37,35,37,38,36,-48,17,29,33,20,-53,-4,14,12,-44,-12,20,23,8,6,-63,-14,4,7,11,0,0,-1,11,-72,4,-5,-7,-3,-10,-5,-1,-11,-81,-17,-5,-16,-85,-4,-18,-17,-4,-14,-26,-10,-93,-12,-26,-23,-19,-30,-30,-31,-19,-102,-26,-35,-37,-33,-40,-35,-31,-41,-97,3715,3723,0,0,4294,3396,3982,7,76,108,88,88,97,89,102,34,48,66,69,73,62,62,61,73,3,72,61,77,55,53,-2,-17,34,53,49,68,-15,59,45,-25,39,49,48,-29,39,46,48,51,55,-21,3765,3786,0,0,0,3492,0,20,51,84,80,93,8,62,88,70,84,83,75,79,71,-1,33,66,74,79,63,75,40,32,70,77,-11,57,63,69,54,-16,51,61,-19,69,58,63,-23,63,57,39,53,-28,51,52,38,51,36,44,49,47,-37,41,39,-40,43,30,26,-44,26,33,-16,3834,3857,0,4097,3619,0,4162,22,50,88,92,7,41,77,83,70,81,77,65,83,67,-3,34,74,79,71,76,56,63,67,28,55,82,79,70,72,78,85,9,-4,68,78,0,75,-9,73,73,61,63,62,-15,71,62,64,56,53,57,49,-9,3893,3904,0,0,0,3564,0,10,68,86,106,92,89,82,100,88,93,91,77,6,38,18,36,36,33,-25,-52,-2,30,27,9,21,10,10,8,-47,-62,-15,12,4,-1,16,1,-69,13,14,8,7,2,14,-76,0,-9,-14,3,4,0,-14,-7,-16,-8,-3,-5,-89,-20,-9,-13,-16,-94,-25,-23,-27,-14,-10,-100,-18,-18,-38,-22,-22,-106,-23,-29,-109,-28,-42,-45,-48,-38,-42,-50,-35,-53,-35,-51,-107,3989,3997,0,0,3708,0,0,7,68,97,107,89,93,89,97,26,43,91,73,85,91,85,72,72,76,68,3,78,-6,63,74,60,59,79,57,0,54,67,57,52,50,-5,4031,4040,0,0,4365,0,3316,8,64,102,98,100,88,88,85,92,56,27,54,51,42,51,49,39,-31,51,36,35,42,47,-37,46,40,-40,31,23,43,25,-45,30,22,22,35,-50,22,32,-53,25,23,-56,27,14,10,-60,-22,11,2,14,19,-66,-28,14,4,-2,-71,11,-4,10,9,-3,1,-7,-65,4104,4127,0,0,0,3827,0,22,65,74,90,87,6,41,86,76,88,70,0,44,63,70,74,79,63,71,57,69,57,58,34,39,81,-4,60,74,73,61,56,72,72,-12,71,65,-15,50,52,-18,68,59,61,53,50,54,46,-26,51,51,53,47,34,44,43,55,-21,4169,4183,0,0,3827,0,0,13,54,100,86,103,15,63,98,77,93,94,78,90,90,35,49,68,64,-6,59,61,59,73,-11,53,69,55,-15,49,59,58,-19,64,58,57,-23,59,52,39,49,48,-29,40,48,50,-33,55,44,49,-23,4226,4238,0,0,0,3316,0,11,72,87,92,87,95,83,84,14,57,77,77,55,34,55,60,-26,56,41,40,-30,38,54,40,34,34,42,30,31,-39,32,28,40,26,-44,34,24,-47,32,33,29,33,27,31,35,25,13,-57,22,20,16,28,15,6,18,-65,2,2,15,4,1,7,-72,14,5,7,-1,-63,4301,4313,0,0,0,0,3708,11,58,98,90,91,95,85,84,96,86,90,82,51,38,59,64,-22,60,45,44,-26,38,-28,58,42,42,52,36,32,44,29,45,30,-39,47,32,42,29,-44,35,30,18,30,34,-50,19,27,29,-54,-4,24,25,15,19,11,7,20,16,9,3,-66,19,-50,-55,4372,4380,0,4457,0,0,4024,7,65,89,99,98,108,85,108,76,8,27,27,36,-48,16,32,18,13,-53,18,10,27,-57,8,10,9,17,-62,16,16,19,7,10,5,21,-1,-3,-72,-3,5,7,-76,6,1,-2,-11,3,-10,-10,-6,-14,-59,-87,1,-10,-5,-84,-10,-24,-94,-21,-11,-14,-14,-99,-22,-22,-18,-103,-23,-20,-33,-23,-39,-109,-27,-26,-30,-44,-114,-28,-44,-52,-34,-105,4464,4484,0,0,4556,4365,0,19,64,81,78,95,91,81,91,95,5,39,75,71,68,75,79,77,70,74,79,71,2,38,-41,42,29,25,-45,32,22,40,35,-50,31,27,26,23,-43,-56,8,-58,21,22,8,21,20,21,17,3,-54,15,0,8,12,1,11,-1,11,-7,-77,-8,-3,-1,-2,0,-83,3,-12,-10,-11,-88,-3,-21,-9,-19,-23,-5,-95,-7,-18,-13,-17,-100,-28,-34,-34,-26,-21,-33,-23,-19,-95,4563,4588,1553,0,0,0,4457,24,56,89,75,88,87,88,84,70,13,50,67,75,79,68,78,66,78,60,-10,27,64,66,65,67,12,53,97,83,93,105,105,87,91,83,25,24,23,3564,4653,27,1796,4097,4664,28,1850,4024,4676,45,0,3252,4686,30,1818,3619,4706,31,1872,3492,4714,16777248,0,3886,4719,41,0,4365,4727,268435490,0,3708,4735,67108899,0,4294,4741,33554468,0,3316,4749,32805,0,4162,4760,1048614,0,3396,4765,39,1829,10,91,104,87,84,98,86,16,95,93,81,11,98,99,95,102,86,94,15,90,78,98,76,9,93,107,90,96,19,85,86,92,91,19,84,85,76,88,93,8,76,82,74,71,87,84,80,77,64,69,75,65,79,7,105,96,102,106,100,98,102,4,95,92,101,94,7,105,103,96,100,105,89,101,7,91,103,108,98,89,89,101,5,104,111,109,93,111,7,90,102,107,91,99,98,84,10,106,86,97,85,97,102,98,88,92,82,4,95,106,99,103,13,92,96,87,89,93,87,97,81,11,86,88,87,87 diff --git a/lib/Extensions.cs b/lib/Extensions.cs deleted file mode 100644 index eb8c3cb..0000000 --- a/lib/Extensions.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; - -namespace aoc2019.lib -{ - public static class Extensions - { - public static IEnumerable> Permute(this IEnumerable list) - { - if (list.Count() == 1) return new[] {list}; - return list.SelectMany(t => Permute(list.Where(x => !x.Equals(t))), (v, p) => p.Prepend(v)); - } - - public static IEnumerable Chunk(this string str, int chunkSize) - { - for (var i = 0; i < str.Length; i += chunkSize) - yield return str.Substring(i, chunkSize); - } - - public static string ToDelimitedString(this IEnumerable enumerable, string delimiter = "") - { - return string.Join(delimiter, enumerable); - } - - public static IEnumerable Repeat(this IEnumerable sequence, int? count = null) - { - while (count == null || count-- > 0) - foreach (var item in sequence) - yield return item; - } - - /// - /// increased accuracy for stopwatch based on frequency. - /// - /// blog - /// details here - /// - /// - /// - /// - public static double ScaleMilliseconds(this Stopwatch stopwatch) - { - return 1_000 * stopwatch.ElapsedTicks / (double) Stopwatch.Frequency; - } - } -} \ No newline at end of file diff --git a/lib/IntCodeVM.cs b/lib/IntCodeVM.cs deleted file mode 100644 index 2190579..0000000 --- a/lib/IntCodeVM.cs +++ /dev/null @@ -1,160 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace aoc2019.lib -{ - public class IntCodeVM - { - public enum HaltType - { - Terminate, - Waiting - } - - private readonly long[] program; - private long i; - public Queue input, output; - public long[] memory; - private long relbase; - - public IntCodeVM(string tape) - { - i = 0; - relbase = 0; - program = tape.Split(',').Select(long.Parse).ToArray(); - memory = program; - input = new Queue(); - output = new Queue(); - } - - public long Result => output.Dequeue(); - - public void Reset() - { - i = 0; - relbase = 0; - memory = program; - input.Clear(); - output.Clear(); - } - - public void AddInput(params long[] values) - { - foreach (var v in values) AddInput(v); - } - - public void AddInput(long value) - { - input.Enqueue(value); - } - - private long MemGet(long addr) - { - return addr < memory.Length ? memory[addr] : 0; - } - - private void MemSet(long addr, long value) - { - if (addr < 0) addr = 0; - if (addr >= memory.Length) - Array.Resize(ref memory, (int) addr + 1); - memory[addr] = value; - } - - private long Mode(long idx) - { - var mode = MemGet(i) / 100; - for (var s = 1; s < idx; s++) - mode /= 10; - return mode % 10; - } - - private long Get(long idx) - { - var param = MemGet(i + idx); - switch (Mode(idx)) - { - case 0: return MemGet(param); - case 1: return param; - case 2: return MemGet(relbase + param); - default: throw new Exception("invalid parameter mode"); - } - } - - private void Set(long idx, long val) - { - var param = MemGet(i + idx); - switch (Mode(idx)) - { - case 0: - MemSet(param, val); - break; - case 1: throw new Exception("cannot set in immediate mode"); - case 2: - MemSet(relbase + param, val); - break; - default: throw new Exception("invalid parameter mode"); - } - } - - public HaltType Run(params long[] additionalInput) - { - foreach (var s in additionalInput) AddInput(s); - return Run(); - } - - public HaltType Run() - { - while (i < memory.Length) - { - var op = MemGet(i) % 100; - switch (op) - { - case 1: - Set(3, Get(1) + Get(2)); - i += 4; - break; - case 2: - Set(3, Get(1) * Get(2)); - i += 4; - break; - case 3: - if (!input.Any()) - return HaltType.Waiting; - Set(1, input.Dequeue()); - i += 2; - break; - case 4: - output.Enqueue(Get(1)); - i += 2; - break; - case 5: - i = Get(1) == 0 ? i + 3 : Get(2); - break; - case 6: - i = Get(1) != 0 ? i + 3 : Get(2); - break; - case 7: - Set(3, Get(1) < Get(2) ? 1 : 0); - i += 4; - break; - case 8: - Set(3, Get(1) == Get(2) ? 1 : 0); - i += 4; - break; - case 9: - relbase += Get(1); - i += 2; - break; - case 99: - return HaltType.Terminate; - default: - throw new Exception($"unknown op {op} at {i}"); - } - } - - return HaltType.Terminate; - } - } -} \ No newline at end of file -- cgit 1.4.1