Massive code base change

partial completion of day 3
This commit is contained in:
Rob 2023-12-03 19:09:26 +01:00
parent 27247c645e
commit 3846b42b7e
66 changed files with 2872 additions and 2549 deletions

View File

@ -1,19 +0,0 @@
using System.Text;
using AdventOfCodeLibrary._2023;
using AdventOfCode.Core.Shared;
string _demoData = @"Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green
Game 2: 1 blue, 2 green; 3 green, 4 blue, 1 red; 1 green, 1 blue
Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red
Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red
Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green";
Answerable answerable = new Day02Part2();
//FileStream stream = new FileStream(answerable.DefaultInputFile, new FileStreamOptions { Mode = FileMode.Open, Access = FileAccess.Read, Options = FileOptions.Asynchronous });
byte[] dataArray = File.ReadAllBytes(answerable.DefaultInputFile);
//dataArray = Encoding.UTF8.GetBytes(_demoData);
Console.WriteLine($"Answer: {answerable.GetAnswer(dataArray)}");

View File

@ -3,13 +3,13 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>AdventOFCodeRunner</RootNamespace>
<RootNamespace>AdventOfCode.Runner</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Advent Of Code Library\AdventOfCode.Solutions.csproj" />
<ProjectReference Include="..\AdventOfCode.Solutions\AdventOfCode.Solutions.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,13 @@
using AdventOfCode.Solutions._2023;
using AdventOfCode.Core.Shared;
using AdventOfCode.Core;
InputReader inputReader = new()
{
IsDebug = true
};
IChallange challange = new Day03(inputReader);
Console.WriteLine($"Part 1: {await challange.GetSolutionPart1()}");
Console.WriteLine($"Part 2: {await challange.GetSolutionPart2()}");

View File

@ -3,11 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33103.184
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdventOfCode.Runner", "Advend Of Code Runner\AdventOfCode.Runner.csproj", "{6DCDC513-AF72-4029-932A-A0079BB5422B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdventOfCode.Core", "AdventOfCode.Core\AdventOfCode.Core.csproj", "{61EF900D-0CDB-4FC2-8E13-73BEFE0A36E0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdventOfCode.Solutions", "Advent Of Code Library\AdventOfCode.Solutions.csproj", "{33CC3924-F18E-4B88-9989-A7A9077B9AC4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdventOfCode.Solutions", "AdventOfCode.Solutions\AdventOfCode.Solutions.csproj", "{BDDFE214-9F20-4BF7-94C6-19BAAF130FDA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdventOfCode.Core", "AdventOfCode.Code\AdventOfCode.Core.csproj", "{49EFF2F1-A5AD-448F-92EE-8CC95B2CECC2}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdventOfCode.Runner", "AdvendOfCode.Runner\AdventOfCode.Runner.csproj", "{9A188168-565C-4D82-8C81-DD3A15386863}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -15,18 +15,18 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6DCDC513-AF72-4029-932A-A0079BB5422B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6DCDC513-AF72-4029-932A-A0079BB5422B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6DCDC513-AF72-4029-932A-A0079BB5422B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6DCDC513-AF72-4029-932A-A0079BB5422B}.Release|Any CPU.Build.0 = Release|Any CPU
{33CC3924-F18E-4B88-9989-A7A9077B9AC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{33CC3924-F18E-4B88-9989-A7A9077B9AC4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{33CC3924-F18E-4B88-9989-A7A9077B9AC4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{33CC3924-F18E-4B88-9989-A7A9077B9AC4}.Release|Any CPU.Build.0 = Release|Any CPU
{49EFF2F1-A5AD-448F-92EE-8CC95B2CECC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{49EFF2F1-A5AD-448F-92EE-8CC95B2CECC2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{49EFF2F1-A5AD-448F-92EE-8CC95B2CECC2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{49EFF2F1-A5AD-448F-92EE-8CC95B2CECC2}.Release|Any CPU.Build.0 = Release|Any CPU
{61EF900D-0CDB-4FC2-8E13-73BEFE0A36E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{61EF900D-0CDB-4FC2-8E13-73BEFE0A36E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{61EF900D-0CDB-4FC2-8E13-73BEFE0A36E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{61EF900D-0CDB-4FC2-8E13-73BEFE0A36E0}.Release|Any CPU.Build.0 = Release|Any CPU
{BDDFE214-9F20-4BF7-94C6-19BAAF130FDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BDDFE214-9F20-4BF7-94C6-19BAAF130FDA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BDDFE214-9F20-4BF7-94C6-19BAAF130FDA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BDDFE214-9F20-4BF7-94C6-19BAAF130FDA}.Release|Any CPU.Build.0 = Release|Any CPU
{9A188168-565C-4D82-8C81-DD3A15386863}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9A188168-565C-4D82-8C81-DD3A15386863}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9A188168-565C-4D82-8C81-DD3A15386863}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9A188168-565C-4D82-8C81-DD3A15386863}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -6,4 +6,8 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<None Remove="InputReader.cs~RF178d210.TMP" />
</ItemGroup>
</Project>

View File

@ -1,13 +1,19 @@
using System.Runtime.InteropServices.Marshalling;
using AdventOfCode.Core.Shared;
namespace AdventOfCode.Core
{
public class InputReader
{
private readonly string InputFileTemplate = "../../../../Advent Of Code Library/{1}/Day {2:00}/day-{2:00}-input.txt";
private readonly string InputFileTemplate = "../../../../AdventOfCode.Solutions/{1}/Day {0:00}/day-{0:00}-input.txt";
private readonly string DebugInputFileTemplate = "../../../../AdventOfCode.Solutions/day-00-input.txt";
public bool IsDebug = false;
private int Day { get; set; }
private int Year { get; set; }
private string InputFilePath => string.Format(InputFileTemplate, Year, Day);
private string InputFilePath => IsDebug ? DebugInputFileTemplate : string.Format(InputFileTemplate, Day, Year);
public InputReader() => SetInputByChallange();
public void SetInputByChallange()
{
@ -36,6 +42,11 @@ namespace AdventOfCode.Core
}
}
public Task<string[]> ReadAsArraytString()
{
return File.ReadAllLinesAsync(InputFilePath);
}
public async IAsyncEnumerable<T> ReadAsStringLine<T>(T emptyLineIndicator)
{
using StreamReader reader = new(InputFilePath);
@ -48,5 +59,20 @@ namespace AdventOfCode.Core
yield return (T)Convert.ChangeType(line, typeof(T));
}
}
public async Task<Grid<T>> ReadToGrid<T>() where T : Node, new()
{
Grid<T> result = new();
int row = 0;
await foreach(string line in ReadAsStringLine())
{
int charIndex = 0;
// create the nodes from the lines
result.DataGrid.AddRange(line.Select(c => new T { X = charIndex++, Y = row, Char = c }));
row++;
}
return result;
}
}
}

View File

@ -1,8 +1,8 @@
using System.Text;
using System.Text.RegularExpressions;
namespace AdventOfCode.Core.Shared
{
using System.Text.RegularExpressions;
public abstract class Answerable
{

View File

@ -1,10 +1,10 @@
using System.Collections.Generic;
namespace AdventOfCode.Core.Shared
namespace AdventOfCode.Core.Shared
{
public class Grid<T> where T : Node
{
public List<T> DataGrid { get; set; } = new List<T>();
public List<T> DataGrid { get; set; } = [];
public Grid() { }
public Grid(T[] data) => DataGrid.AddRange(data);
@ -23,7 +23,11 @@ namespace AdventOfCode.Core.Shared
}
return neighbors.Where(target => !(Math.Abs(source.X - target.X) <= 1 && Math.Abs(source.Y - target.Y) <= 1));
}
public IEnumerable<T> GetSection(int fromX, int fromY, int toX, int toY)
{
return DataGrid.Where(node => node.X >= fromX && node.X <= toX && node.Y >= fromY && node.Y <= toY);
}
}

View File

@ -0,0 +1,9 @@
namespace AdventOfCode.Core.Shared
{
public interface IChallange
{
Task<string> GetSolutionPart1();
Task<string> GetSolutionPart2();
}
}

View File

@ -2,10 +2,12 @@
{
public class Node
{
internal int X { get; set; }
internal int Y { get; set; }
internal char Char { get; }
internal short Integer => (short)Char;
public int X { get; set; }
public int Y { get; set; }
public char Char { get; set; }
public short Integer => (short)Char;
public Node() { }
public Node(int x, int y, char character)
{
@ -21,5 +23,10 @@
{
return Math.Abs(X - other.X) + Math.Abs(Y - other.Y);
}
public override string ToString()
{
return $"[{Y},{X}] {Char}";
}
}
}

View File

@ -0,0 +1,123 @@
using AdventOfCode.Core;
using System.Text.RegularExpressions;
using static System.Runtime.InteropServices.JavaScript.JSType;
namespace AdventOfCode.Solutions._2023
{
public partial class Day03(InputReader reader) : IChallange
{
private InputReader _inputReader = reader;
private class PartNumber
{
public int X { get; set; }
public int Y { get; set; }
public string Section { get; set; } = string.Empty;
public int Length => Section.Length;
public bool IsDigit() => Section.Length > 1;
public bool IsPartSymbol() => !IsDigit();
public override string ToString()
{
return $"[{Y},{X}] {Section}";
}
}
public async Task<string> GetSolutionPart1()
{
List<PartNumber> parts = [];
int row = 0;
int total = 0;
await foreach (string line in _inputReader.ReadAsStringLine())
{
MatchCollection matchCollection = FindPartItems().Matches(line);
parts.AddRange(matchCollection.Select(match => new PartNumber { X = match.Index, Y = row, Section = match.Value }));
row++;
}
List<PartNumber> numbers = parts.Where(p => p.IsDigit()).ToList();
List<PartNumber> symbols = parts.Where(p => p.IsPartSymbol()).ToList();
var intersected = numbers.Where(number => GetSection(symbols, number.X - 1, number.Y - 1, number.X + number.Length, number.Y + 1).Any()).ToList();
total = numbers.Where(number => GetSection(symbols, number.X - 1, number.Y - 1, number.X + number.Length, number.Y + 1).Any()).Sum(number => int.Parse(number.Section));
//Grid<Node> grid = await _inputReader.ReadToGrid<Node>();
//int row = 0;
//
//await foreach(string line in _inputReader.ReadAsStringLine())
//{
// MatchCollection matchCollection = FindDigits().Matches(line);
//
// foreach (Match match in matchCollection.Cast<Match>())
// {
// var section = grid.GetSection(match.Index - 1, row - 1, match.Index + match.Length, row + 1).ToList();
// bool isPartNumber = section.Any(n => !(n.Char == '.' || (n.Char >= '0' && n.Char <= '9')));
// if (isPartNumber) {
// total += int.Parse(match.Value);
// }
// }
//
// row++;
//}
return total.ToString();
}
public async Task<string> GetSolutionPart2()
{
List<PartNumber> parts = [];
int row = 0;
int total = 0;
await foreach (string line in _inputReader.ReadAsStringLine())
{
MatchCollection matchCollection = FindPartItems().Matches(line);
parts.AddRange(matchCollection.Select(match => new PartNumber { X = match.Index, Y = row, Section = match.Value }));
row++;
}
List<PartNumber> numbers = parts.Where(p => p.IsDigit()).ToList();
List<PartNumber> gears = parts.Where(p => p.IsPartSymbol() && p.Section == "*").ToList();
foreach (PartNumber gear in gears)
{
// check if there are 2 numbers around
List<PartNumber> ratios = GetSection(numbers, gear).ToList();
if (ratios.Count != 2)
continue;
int totalRatio = int.Parse(ratios[0].Section) * int.Parse(ratios[1].Section);
total += totalRatio;
}
return total.ToString();
}
private IEnumerable<PartNumber> GetSection(List<PartNumber> toSearch, int fromX, int fromY, int toX, int toY)
{
return toSearch.Where(node => node.X >= fromX && node.X + node.Length <= toX && node.Y >= fromY && node.Y <= toY);
}
private IEnumerable<PartNumber> GetSection(List<PartNumber> toSearch, PartNumber source)
{
return toSearch.Where(target =>
target.X >= source.X - 1 &&
target.X + target.Length <= source.X &&
target.Y >= source.Y - 1 &&
target.Y <= source.Y + 1);
}
[GeneratedRegex("(\\d+)", RegexOptions.Compiled)]
private static partial Regex FindDigits();
[GeneratedRegex("(\\d+)|([^.])", RegexOptions.Compiled)]
private static partial Regex FindPartItems();
}
}

View File

@ -0,0 +1,140 @@
.......................153..988....502..842.........588.....441.468......481..........314...715.57............................163..992..512.
............805............*......#.............%...............*........=......%......................#......*.............-....#....*.....
........914.........#...617..201.........271.....671......52..898................847..........*230..215......393..%751....537...............
..........#......361..........*...........*............-4.............165..609........922..133...........706..................*....552*127..
490*..........................350...*...664........806................../..*...514.31...=........../25....%.................83..............
....245...............805...........467.......449...+..............313*....115....*.......611.343............$...237..229...................
........................*.....150.............*..............8.........511...................*........#.....837.*......*....*...............
435.................688.8..............$......330.................474.......9.......736...........*...787........336...245...446.....916....
...*.*....920........%................666..90.....786$..221.......*.....173.%.......*........@..25.98.....186#.......................*......
.718.120..@.............$.931................*...........*....15...10....*.........649....&.542.....................-.......@.......106.....
.............-.......794...................486.........209....*..2........252..........517...................250.519......274...............
...636.....500........................878.......106.........487..*....819........353.........678.........../..-...............539...........
.............................43......*...........$.......44.....881....*...662*...%................407#...612.......452@.286................
..................................195..543.../.......75..............887.......43...396..................................=.............813..
........$.735......590.998.............=...862............228......................*................+...%...........979.....500=......*.....
......597..........=...+.........61..................878../....596......*........542../815....567.834..672.=378.....*...&.........#..981....
...................................*618..998.........*...............716..........................................495.682..62..945..........
.......915..............156.................$.......298........479........170............985............+90..../.............@.....&7.......
...800*.............246*.........370..............................-.........*....639....*.....362.368.......818................687..........
.........$.173............383=......*........389......................273....785.....514....=...*....*...........@..............*....446*833
.433...227...*...-.-...............770.988.................738.523...*....................397....599..499...&..385.........*199.35..........
...%........40.437..300../....740.........*...................*...........................................192......&....272............*....
........#.................305.......318.608..609....*..............448......@...959*604....16*...../..............131............=..325.215.
.980...85....*48......883.............@..............663.................128..................944.420...203.....................381.........
..........887............*....434........725................958......367......178..........................@.779.........................986
.......................591...*......964.*....713.140..........*..698....*......................772.......................914........223.....
...........960.....*....................80.....#..%....456..824....*...138...939.........362*......488...572........663..&..........*.......
.......+.....*...645.............%12.....................*.........692...............922.....902..@.................*........27..542........
...792..242.702.........256..668..............613*479...329...................134#....*...................*545...375........................
.......................&......*.............&..........................298.........696.................844.....=....................184.....
......886=..................129....187.......850..*.....&................*...............358...130............500................@.....*....
.............*54..112.............*..............791..215...787.........437..889..............*........584........../226......366...483.....
.......47..........*....826.500..48......665..................*.................*.377....#...49.......$.....................................
.196...*..........815......*..............*.....*...........571........297*...153.*....416...............+.....73...126.............111.....
.......164............547#................69.503.743............108...............22......../70....36.....470................516....*.......
....................................634................&.357......*...................275.........+................592......%....52.204.....
....#943....843............544.......-.....96*139...640........694................@.........558......................*...........*.......104
..............*....731.......*...382...................................../...%557..857......*....-................716..638./165...338.......
......926....342../..........861............/......................#...768...................569..192...................*...................
..272....................500.......*.........784......558..38.....786..........238.932%................/...827....841............76.........
.....*25....=..780.74...........457....%..%.......806........*........&........*...........+..........53..*..........%.............*........
..99.....697...$....+................601.757.600...........751........801......795..998....362...........431......&............797.860......
....*...................50.579...............&...-.878.....................586.....*............587..216.......321...783....................
...859.................@.....+.317/............34../...499.....904.991.......$....938......337@...*..#.................*.............130*312
............707.266.....................156..9............*.......*..............................880.......787.........102..................
.........*.....*................938*743...*.*..............195.........425..........869*.....448..........*.....73.689.....48..469..........
......568.164....938........................964.......899......641.....*........930.............*...891....104........*...&.......*719......
....................*..................#...........+..-...381......36.749...744..*......659...935......+..............694.....370...........
........174........460............+..435........893........%................+.....500......$.............#......397.............*...549.677.
....981.*.....&355.....960.......963..................543#.........................................971...483....%............428.....=......
354..*................*.....752..................69........676..54.......531*......78....877..-950....%............346...........699........
......265.....#......959.................846.......*...93............263.....974....=.......*............&........................*.........
............857...........527............../.......29....@.846.......*.....................768..134&...571..........302...........512.......
....$254.........397......*............./....................%....128.........*984.....693..................991...+...*.@....@...........228
............335...*.....751......626.699............$118..............991..............$....................*...327.93..508.301......348....
....387........@.266..............*.......................-...........*.......%...................260....756................................
....*.....817..................726...391.....112..........273..997...197....667......./......932*....$........290...............711......560
...488.....&....961.....170.........*..........*................*.........*........883..825......71..............&...215...........*.766....
...............+.........#....$.....600.&.......674.42.................730.998.........*..................139.........*.........461....=....
...#97...........817........86..........155..............759.....200.............827...163..........................499.....................
.....................#.........................793*722...........................$..............&....725&......................442..........
.............812....613.....892..........................464......430..%.....462.....%.......599.............555..204....219......*637......
...544........./............&...............................*.......*.840.......*...994.797........52.........*....*..........739...........
....=..................................713.304...161........186.................824.......-....=....*.......118.844..113......*.....872.....
......................75.963......244.....*.....*.......466..........590....................208....363...............*.....872..............
.............391.....*...............*.......843......#..........184..-.................................441......448.597....................
979......416......114................306.%.........719.....792......$...........................#..........*..............603.989.914*......
.........-..................975..670.....890...621...........*..........145..659...369=.@978....935........938...............*........107...
................259..%632....=...................*......173...871........*...................4..........*..........&108.........*281........
...............*................326.....732...528.../....#.............698.............316..*........188.888.................918............
..512........507...............*...........*........440.........................938......./.254..313...............................422......
....*............300.........430..354$.....884.701.......%....368............../....@480...........*..142.............305...145.61......106.
.363..939.639..................................$...../....704.....835@...-776....................655.........645......*......*....*892......
.........*..........*338................../........741........................113..895...............%..403.....*..40..992..2...............
.................986...........927..%449.17............................182....*.....=......870......899........665.#.................949.189
...841.........................*.......................................*...849...........=....*295.........420..............441.882.........
......$..+.............124...993..........*...........*................365..........79.364................*.............414*.....-.....360..
........159...........*...........457$....199......960.967...&...................................+......181.....+.......................*...
.....................859...................................962.............912....#......330.....168...........904.....958*....213*583..49..
........%.........*..........421..340*196..892.........409.................*....488.645...*..........#......................................
.....802........116...........*...........................*...227........791.........$....203.....963..418................599+..........744.
..............#.....-966.23.94...58..283...........476....722.......730...........................................@..700.......%788.........
240%..........844..................*.-.........486............307............#49...288........&.329.............61..*.....................95
.........#............148..446...........402/..........256.......................&..........573..*...................319.......763..........
......936..............*...%.................................-....709...371...955..352............553.629....445..................*.........
.121......445.347...455.......=....#....92..................367..*......*............@........881........*..*....267/.....-89......843.*782.
......519.=.....*.........401.996.452...-.......-387.886.........982...149..910%..........81..-.........653..407......819.......@...........
.....*.......950...448#....*...............&691......$......................................*....538..............681*.........560..........
.....25....................60............*......................304*863...../.............103......*.........811..........923.......426.....
.800..................../................974..............255..............958....738..............465.........*......181...+........./.....
....*.....-......824....782........90...........+505.......*....903...................544.712.826...........800..........*..................
...408..123...-.........................................557.......*....................@.....*....561.743............310..642...97*475......
...............900.#494.....915.624............../..............508.....431.*500.........986...../......=....187........*...................
...........................*......*....#741.@957.979.*................/..%................%.............................218.805......505*...
...........................59.....595.................948...+........885.....*808...554.........70......827=.............................690
...95........+......455.....................................776...........795......=..............&...$........349...............621*80.....
...*....../.793..$...#.....................842..........898.........729...................698.......273...704...*.......451..%..............
.......340......911......865.....876..........-...........*...%......*....676*498..424...-.......=.........*........241..#...967.......323..
........................-...........*271..578...........734..8..692..435....................698.548.................@...................*...
.....=......*..................131...........=..=..............*.............523.659...221...+........................468..263..395.408..757
.....236....661...565*...........#...............228............287...448.......*......&......................=.........#.+........*........
......................982.................$..........403*317.............*103.................454...#...311....588...................105....
...72...............................246..991...../...........12................%.........271...=....668.................................*...
.......348...259......$..../384.221...............873.......*.....560....&...686............*..................241............763........884
........*...+..........848.................=........................*.....76......*....889..417.404...............&...538.663..=......61....
.......446....948..805.....615.....303+.372..........893.......945...849.........861....*........*...187.980...&....../...........838.+.....
...453...............*....*.....................357...../.........+....................506....129..@.......*..633.822............*..........
......*188........495....732............635*.....$............219........65....475................811...231..........*..332%...212..........
.................................*..........575.....-....591...*...420.........*...............................897.317.............165...762
.............764..410.............438....*..........588....*.245..%......*.....468..........32..-714...456.........................*....*...
..............*.......................516.552...366......416........166...552.................*.............../..126.........396.386....921.
.......&.............67&........468................*.............................403.221.......433.....411..299..........457*...............
.....539.......*287.............*............657/.457..............614........34*......*.....$......12*.........693.........................
............908......@602..176..358..778...............72...-..............$..........161.579..................*................571*602.....
...........................*............*799...........*.....118........788....689................$....../702..493.......117............%...
.................337..496..504.......................519............#..........=....744........782...................625.*.......499.....576
.......459..%..............................................28.....398...............*..............*19....#935.........$..845......#........
.............707.....................992........289...481+...*..................3..234....822$.......................................#......
..513.914*.........161......664.....*..........@..............922......$.........*......................330..............@...........798....
..........378.................*..258...............219+.313.........836.....=226.566.....748....&...147*......872.......786..538.446........
.....*827...........907....844.............684..........@..................................*..263............../....8..............=...*....
835........$...88......*.........308.........*.....161.....621*327..-184....333.........@.473.....205..................................872..
...*....340.............744........-.........961....../........................*449...740........*................867.427..251..............
..988........@...................................................765..........................743......228...............*........942.......
.............125..#...........406.........%.....837.................*.....609*.........%..........644...=..465*643....880..509...*.......453
....544..........480.............=.........274.....*..148..583...821..........880.....492....535...@.......................*............*...
.....$.......306................................287....#..*...........647.....................$........-......166.714....942..675.....657...
................*....................673...780...........620..........*.........&..........=......997.465..........$.............*..........
.456........920..855.913..............*.../.....325*316.......6.......208....486........715.....=...%.............................67........
......*178..+.............686.59....871.................$......*.............................149..............238........634................
....56.........385...648*...............*968..&.......732.....921.467........*.........479.........695*284.../..........*...................
............56.....$.....675..746#.............384.................*......451.709................................%..939..265.........290*891
................501.......................620.............900.......825.................258...387......21*40...273...*......................
.......532..................................*....*....956....=....................711.........&.....................415.307....411......9...
..............................314../......692.214.718.............762*461.....844*.....&.............973.675...80.................*143......
...........365.......460.329.@......476....................................*..........926.....799...*.............-.........................
..............*.297...*...*.........................753........700......473.765..............*....967........111.629.932....125.............
.......+...261...&.......786.283....695.....486.....*......565.+................536...../....380....../124..%........*.........%............
......339..............*..............*....*.......996.......-.....+..............*......752......................@...............-.........
.......................716...........551.631........................279..555.....373...................691......114.215............515......

View File

@ -8,7 +8,13 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\AdventOfCode.Code\AdventOfCode.Core.csproj" />
<ProjectReference Include="..\AdventOfCode.Core\AdventOfCode.Core.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="2023\Day 03\Day03.cs">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Compile>
</ItemGroup>
</Project>

View File

@ -0,0 +1,10 @@
467..114..
...*......
..35..633.
......#...
617*......
.....+.58.
..592.....
......755.
...$.*....
.664.598..