implement level1 and level2

This commit is contained in:
Simon Diesenreiter
2024-12-02 18:51:49 +01:00
parent f7f3a2b2a0
commit 377ef9afe8
15 changed files with 3708 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="../Common/Common.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,43 @@
namespace AoC24;
using AoC24.Common;
using AoCLevelInputProvider;
using Parsing;
using Parsing.Schema;
public class LevelXSolver : LevelSolverBase
{
public override int LevelNumber
{
// TODO: update level number, csproj file and rename class!
get { return 1; }
}
protected override InputSchemaBuilder DefineInputSchema(InputSchemaBuilder schemaBuilder)
{
return schemaBuilder
.Repeat()
.Expect(InputType.Integer)
.EndRepetition();
}
public override string SolveFirstStar()
{
var data = this.GetData()
.AsListRows<int>();
// TODO: implement
return string.Empty;
}
public override string SolveSecondStar()
{
var data = this.GetData()
.AsListRows<int>();
// TODO: implement
return string.Empty;
}
}

24
LevelTemplate/Program.cs Normal file
View File

@@ -0,0 +1,24 @@
// See https://aka.ms/new-console-template for more information
using AoC24;
var levelSolver = new LevelXSolver();
var solution1 = levelSolver.SolveFirstStar();
var solution2 = levelSolver.SolveSecondStar();
if (!string.IsNullOrEmpty(solution1))
{
Console.WriteLine("Solution for example 1 is: " + solution1);
}
else
{
Console.WriteLine("Example 1 has not been solved yet!");
}
if (!string.IsNullOrEmpty(solution2))
{
Console.WriteLine("Solution for example 2 is: " + solution2);
}
else
{
Console.WriteLine("Example 2 has not been solved yet!");
}