Compare commits

...

4 Commits

Author SHA1 Message Date
Ben Harris ffcada8a24
Fix day14
continuous-integration/drone/push Build is passing Details
2020-12-02 02:00:24 -05:00
Ben Harris 0957ac4c44
set Part1() and Part2() to protected 2020-12-02 01:58:54 -05:00
Ben Harris 5c58a0cfea
add all input files 2020-12-02 01:31:12 -05:00
Ben Harris 1bde67a32c
work on day 14 2020-12-02 01:31:01 -05:00
27 changed files with 360 additions and 45 deletions

View File

@ -4,7 +4,6 @@ name: run
steps:
- name: run
image: mcr.microsoft.com/dotnet/core/sdk:latest
image: mcr.microsoft.com/dotnet/sdk:latest
commands:
- dotnet run

6
Day.cs
View File

@ -9,7 +9,7 @@ namespace aoc2019
{
public abstract int DayNumber { get; }
public virtual IEnumerable<string> Input =>
protected virtual IEnumerable<string> Input =>
File.ReadLines($"input/day{DayNumber}.in");
public virtual void AllParts(bool verbose = false)
@ -31,7 +31,7 @@ namespace aoc2019
Console.WriteLine();
}
public abstract string Part1();
public abstract string Part2();
protected abstract string Part1();
protected abstract string Part2();
}
}

View File

@ -32,12 +32,12 @@ namespace aoc2019
return total;
}
public override string Part1()
protected override string Part1()
{
return $"{masses.Sum(FuelCost)}";
}
public override string Part2()
protected override string Part2()
{
return $"{masses.Sum(FullCost)}";
}

View File

@ -23,7 +23,7 @@ namespace aoc2019
public override int DayNumber => 10;
public override string Part1()
protected override string Part1()
{
foreach (var asteroid in asteroids)
{
@ -43,7 +43,7 @@ namespace aoc2019
return $"{bestcansee}";
}
public override string Part2()
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)

View File

@ -80,12 +80,12 @@ namespace aoc2019
return map;
}
public override string Part1()
protected override string Part1()
{
return $"{PaintShip(0).Count}";
}
public override string Part2()
protected override string Part2()
{
var map = PaintShip(1);
var minX = (int) map.Keys.Select(x => x.x).Min();

View File

@ -6,9 +6,8 @@ namespace aoc2019
{
internal sealed class Day12 : Day
{
private readonly List<Position> startingPositions;
private readonly List<Position> moons;
private readonly List<Position> startingPositions;
private int step;
public Day12()
@ -54,7 +53,7 @@ namespace aoc2019
step++;
}
public override string Part1()
protected override string Part1()
{
while (step < 1000)
Step();
@ -62,7 +61,7 @@ namespace aoc2019
return $"{moons.Sum(p => p.TotalEnergy)}";
}
public override string Part2()
protected override string Part2()
{
int cycleX = 0, cycleY = 0, cycleZ = 0;

View File

@ -55,14 +55,14 @@ namespace aoc2019
}
}
public override string Part1()
protected override string Part1()
{
vm.Reset();
vm.Run();
return $"{vm.output.Where((v, i) => (i + 1) % 3 == 0 && v == 2).Count()}";
}
public override string Part2()
protected override string Part2()
{
vm.Reset();
vm.memory[0] = 2;

View File

@ -22,9 +22,9 @@ namespace aoc2019
private bool Consume(string chem, long quantity)
{
if (quantity <= 0)
throw new ArgumentOutOfRangeException();
throw new ArgumentOutOfRangeException(nameof(quantity));
if (!available!.ContainsKey(chem))
if (!available.ContainsKey(chem))
available[chem] = 0;
if (available[chem] < quantity && !Produce(chem, quantity - available[chem]))
@ -46,22 +46,29 @@ namespace aoc2019
if (!Consume(reactant.Name, reactionCount * reactant.Quantity))
return false;
available![chem] = available.GetValueOrDefault(chem) + reactionCount * reaction.product.Quantity;
available[chem] = available.GetValueOrDefault(chem) + reactionCount * reaction.product.Quantity;
return true;
}
public override string Part1()
protected override string Part1()
{
available = new Dictionary<string, long> {{"ORE", long.MaxValue}};
Consume("FUEL", 1);
return $"{long.MaxValue - available["ORE"]}";
}
public override string Part2()
protected override string Part2()
{
available = new Dictionary<string, long> {{"ORE", 1000000000000}};
Consume("FUEL", long.MaxValue);
return "";
const long capacity = 1_000_000_000_000;
available = new Dictionary<string, long> {{"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

View File

@ -14,12 +14,12 @@ namespace aoc2019
public override int DayNumber => 15;
public override string Part1()
protected override string Part1()
{
return "intcode solution";
}
public override string Part2()
protected override string Part2()
{
return "";
}

View File

@ -4,12 +4,12 @@ namespace aoc2019
{
public override int DayNumber => 16;
public override string Part1()
protected override string Part1()
{
return "";
}
public override string Part2()
protected override string Part2()
{
return "";
}

View File

@ -30,12 +30,12 @@ namespace aoc2019
return v[0];
}
public override string Part1()
protected override string Part1()
{
return $"{RunIntCode(12, 2)}";
}
public override string Part2()
protected override string Part2()
{
for (var i = 0; i < 100; i++)
for (var j = 0; j < 100; j++)

View File

@ -17,12 +17,12 @@ namespace aoc2019
public override int DayNumber => 3;
public override string Part1()
protected override string Part1()
{
return $"{intersections.Min(x => Math.Abs(x.Item1) + Math.Abs(x.Item2))}";
}
public override string Part2()
protected override string Part2()
{
// add 2 to count (0, 0) on both lines
return $"{intersections.Min(x => wires[0][x] + wires[1][x]) + 2}";

View File

@ -38,12 +38,12 @@ namespace aoc2019
return IsValid(i) && s.Select(c => s.Count(j => j == c)).Any(c => c == 2);
}
public override string Part1()
protected override string Part1()
{
return $"{Enumerable.Range(start, end).Count(IsValid)}";
}
public override string Part2()
protected override string Part2()
{
return $"{Enumerable.Range(start, end).Count(HasOnePair)}";
}

View File

@ -65,13 +65,13 @@ namespace aoc2019
}
}
public override string Part1()
protected override string Part1()
{
RunIntCode(tape.ToList(), 1);
return $"{output}";
}
public override string Part2()
protected override string Part2()
{
RunIntCode(tape.ToList(), 5);
return $"{output}";

View File

@ -23,12 +23,12 @@ namespace aoc2019
return res;
}
public override string Part1()
protected override string Part1()
{
return $"{input.Keys.Sum(o => GetParents(o).Count - 1)}";
}
public override string Part2()
protected override string Part2()
{
var you = GetParents("YOU");
var san = GetParents("SAN");

View File

@ -16,7 +16,7 @@ namespace aoc2019
public override int DayNumber => 7;
public override string Part1()
protected override string Part1()
{
long i, largest = 0;
@ -37,7 +37,7 @@ namespace aoc2019
return $"{largest}";
}
public override string Part2()
protected override string Part2()
{
long i, largest = 0;

View File

@ -16,13 +16,13 @@ namespace aoc2019
public override int DayNumber => 8;
public override string Part1()
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')}";
}
public override string Part2()
protected override string Part2()
{
return Enumerable.Range(0, 25 * 6)
.Select(p => Enumerable.Range(0, photo.Count)

View File

@ -14,14 +14,14 @@ namespace aoc2019
public override int DayNumber => 9;
public override string Part1()
protected override string Part1()
{
vm.Reset();
vm.Run(1);
return $"{vm.output.ToDelimitedString(",")}";
}
public override string Part2()
protected override string Part2()
{
vm.Reset();
vm.Run(2);

1
input/day17.in Normal file
View File

@ -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

81
input/day18.in Normal file
View File

@ -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.#.....#
#################################################################################

1
input/day19.in Normal file
View File

@ -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

119
input/day20.in Normal file
View File

@ -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

1
input/day21.in Normal file

File diff suppressed because one or more lines are too long

100
input/day22.in Normal file
View File

@ -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

1
input/day23.in Normal file

File diff suppressed because one or more lines are too long

5
input/day24.in Normal file
View File

@ -0,0 +1,5 @@
##.#.
##.#.
##.##
.####
.#...

1
input/day25.in Normal file

File diff suppressed because one or more lines are too long