Completed day 7

This commit is contained in:
Rob 2023-12-07 23:41:07 +01:00
parent bf28d5e69c
commit 0354117851
4 changed files with 14 additions and 36 deletions

View File

@ -4,12 +4,12 @@ using AdventOfCode.Core;
InputReader inputReader = new() InputReader inputReader = new()
{ {
IsDebug = true //IsDebug = true
}; };
//inputReader.SetInputByChallange(3); //inputReader.SetInputByChallange(3);
IChallange challange = new Day05(inputReader); IChallange challange = new Day07(inputReader);
Console.WriteLine($"Part 1: {await challange.GetSolutionPart1()}"); Console.WriteLine($"Part 1: {await challange.GetSolutionPart1()}");

View File

@ -81,7 +81,7 @@ namespace AdventOfCode.Solutions._2023
long lowestLocation = long.MaxValue; long lowestLocation = long.MaxValue;
List<long> proccessed = []; List<long> proccessed = [];
// change to use ranges and shift those
for (int seedDataIndex = 0; seedDataIndex < seedData.Length; seedDataIndex += 2) for (int seedDataIndex = 0; seedDataIndex < seedData.Length; seedDataIndex += 2)
{ {
for (long seedLocaton = seedData[seedDataIndex]; seedLocaton < seedData[seedDataIndex] + seedData[seedDataIndex + 1]; seedLocaton++) for (long seedLocaton = seedData[seedDataIndex]; seedLocaton < seedData[seedDataIndex] + seedData[seedDataIndex + 1]; seedLocaton++)

View File

@ -12,6 +12,12 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Update="2023\Day 07\Day07.cs">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Compile>
<Compile Update="2023\Day 06\Day06.cs">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Compile>
<Compile Update="2023\Day 00\Day00.cs"> <Compile Update="2023\Day 00\Day00.cs">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Compile> </Compile>

View File

@ -1,33 +1,5 @@
seeds: 79 14 55 13 32T3K 765
T55J5 684
seed-to-soil map: KK677 28
50 98 2 KTJJT 220
52 50 48 QQQJA 483
soil-to-fertilizer map:
0 15 37
37 52 2
39 0 15
fertilizer-to-water map:
49 53 8
0 11 42
42 0 7
57 7 4
water-to-light map:
88 18 7
18 25 70
light-to-temperature map:
45 77 23
81 45 19
68 64 13
temperature-to-humidity map:
0 69 1
1 0 69
humidity-to-location map:
60 56 37
56 93 4