Skip to content

Commit 493f3cf

Browse files
committed
2024 day 2 part 1 complete
1 parent ee27ecf commit 493f3cf

File tree

10 files changed

+1180
-25
lines changed

10 files changed

+1180
-25
lines changed

2024/AdventOfCode2024.Tests/Day1Tests.cs

+11-16
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,20 @@ namespace AdventOfCode2024.Tests;
44

55
public class Day1Tests
66
{
7+
private const string ExampleInput = """
8+
3 4
9+
4 3
10+
2 5
11+
1 3
12+
3 9
13+
3 3
14+
""";
15+
716
[Fact]
817
public void Part1_Sample_IsCorrect()
918
{
1019
var day = new Day1();
11-
var result = day.Part1("""
12-
3 4
13-
4 3
14-
2 5
15-
1 3
16-
3 9
17-
3 3
18-
""");
20+
var result = day.Part1(ExampleInput);
1921

2022
Assert.Equal("11", result);
2123
}
@@ -24,14 +26,7 @@ 3 3
2426
public void Part2_Sample_IsCorrect()
2527
{
2628
var day = new Day1();
27-
var result = day.Part2("""
28-
3 4
29-
4 3
30-
2 5
31-
1 3
32-
3 9
33-
3 3
34-
""");
29+
var result = day.Part2(ExampleInput);
3530

3631
Assert.Equal("31", result);
3732
}
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using AdventOfCode2024.Days;
2+
3+
namespace AdventOfCode2024.Tests;
4+
5+
public class Day2Tests
6+
{
7+
private const string ExampleInput = """
8+
7 6 4 2 1
9+
1 2 7 8 9
10+
9 7 6 2 1
11+
1 3 2 4 5
12+
8 6 4 4 1
13+
1 3 6 7 9
14+
""";
15+
16+
[Fact]
17+
public void Part1_Sample_IsCorrect()
18+
{
19+
var day = new Day2();
20+
var result = day.Part1(ExampleInput);
21+
22+
Assert.Equal("2", result);
23+
}
24+
}

2024/AdventOfCode2024.sln.DotSettings.user

+3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AEnumerable_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Ffcf0ec63a5154dda96b25a127f4b25649d400_003F7f_003F7f9cb70a_003FEnumerable_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
23
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANumber_002EParsing_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F663a09bb4626f9a993344296223a5407b8ccd7fba6d13c4abbf5b7161bbd1f_003FNumber_002EParsing_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
4+
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AString_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F22a6757d52404266b970fa51436fd5a3e24e00_003F6b_003F0d56d9c1_003FString_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
35
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=706dc741_002D2c60_002D4647_002D868b_002D68cfbf1b3b5a/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" Name="Part1_Sample_IsCorrect #3" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;
46
&lt;TestAncestor&gt;
57
&lt;TestId&gt;xUnit::3622859B-381B-48D3-B71A-932824B5A500::net9.0::AdventOfCode2024.Tests.Day1Tests.Part1_Sample_IsCorrect&lt;/TestId&gt;
68
&lt;TestId&gt;xUnit::3622859B-381B-48D3-B71A-932824B5A500::net9.0::AdventOfCode2024.Tests.Day1Tests.Part2_Sample_IsCorrect&lt;/TestId&gt;
9+
&lt;TestId&gt;xUnit::3622859B-381B-48D3-B71A-932824B5A500::net9.0::AdventOfCode2024.Tests.Day2Tests.Part1_Sample_IsCorrect&lt;/TestId&gt;
710
&lt;/TestAncestor&gt;
811
&lt;/SessionState&gt;</s:String>
912
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=89c8c185_002D52f0_002D4e30_002Da90e_002D0d2394c51e03/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" Name="Part1_Sample_IsCorrect" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;

2024/AdventOfCode2024/AdventOfCode2024.csproj

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>
99
<PublishAot>true</PublishAot>
10+
<OptimizationPreference>Speed</OptimizationPreference>
1011
<InvariantGlobalization>true</InvariantGlobalization>
1112
</PropertyGroup>
1213

@@ -15,4 +16,11 @@
1516
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
1617
</Content>
1718
</ItemGroup>
19+
20+
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
21+
<DefineConstants>$(DefineConstants);RELEASE;TRACE</DefineConstants>
22+
<DebugSymbols>false</DebugSymbols>
23+
<DebugType>portable</DebugType>
24+
<Optimize>true</Optimize>
25+
</PropertyGroup>
1826
</Project>

0 commit comments

Comments
 (0)