Added empty skeleton implementations and tests for days 17, 18, and 19

This commit is contained in:
Stefan Müller 2023-12-19 17:57:58 +01:00 committed by Stefan Müller
parent 01ec0be32c
commit 58da932860
10 changed files with 492 additions and 2 deletions

View File

@ -101,6 +101,18 @@
<Filename Value="solvers\UFloorWillBeLava.pas"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="solvers\UAplenty.pas"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="solvers\UClumsyCrucible.pas"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="solvers\ULavaductLagoon.pas"/>
<IsPartOfProject Value="True"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>

View File

@ -25,7 +25,8 @@ uses
{$ENDIF}
Classes, SysUtils, CustApp, USolver, UTrebuchet, UCubeConundrum, UGearRatios, UScratchcards, UGiveSeedFertilizer,
UWaitForIt, UCamelCards, UHauntedWasteland, UNumberTheory, UMirageMaintenance, UPipeMaze, UCosmicExpansion,
UHotSprings, UPointOfIncidence, UParabolicReflectorDish, ULensLibrary, UFloorWillBeLava;
UHotSprings, UPointOfIncidence, UParabolicReflectorDish, ULensLibrary, UFloorWillBeLava, UClumsyCrucible,
ULavaductLagoon, UAplenty;
type
@ -66,6 +67,9 @@ begin
engine.RunAndFree(TParabolicReflectorDish.Create);
engine.RunAndFree(TLensLibrary.Create);
engine.RunAndFree(TFloorWillBeLava.Create);
engine.RunAndFree(TClumsyCrucible.Create);
engine.RunAndFree(TLavaductLagoon.Create);
engine.RunAndFree(TAplenty.Create);
engine.Free;
end;

64
solvers/UAplenty.pas Normal file
View File

@ -0,0 +1,64 @@
{
Solutions to the Advent Of Code.
Copyright (C) 2023 Stefan Müller
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
}
unit UAplenty;
{$mode ObjFPC}{$H+}
interface
uses
Classes, SysUtils, USolver;
type
{ TAplenty }
TAplenty = class(TSolver)
public
procedure ProcessDataLine(const ALine: string); override;
procedure Finish; override;
function GetDataFileName: string; override;
function GetPuzzleName: string; override;
end;
implementation
{ TAplenty }
procedure TAplenty.ProcessDataLine(const ALine: string);
begin
end;
procedure TAplenty.Finish;
begin
end;
function TAplenty.GetDataFileName: string;
begin
Result := 'aplenty.txt';
end;
function TAplenty.GetPuzzleName: string;
begin
Result := 'Day 19: Aplenty';
end;
end.

View File

@ -0,0 +1,64 @@
{
Solutions to the Advent Of Code.
Copyright (C) 2023 Stefan Müller
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
}
unit UClumsyCrucible;
{$mode ObjFPC}{$H+}
interface
uses
Classes, SysUtils, USolver;
type
{ TClumsyCrucible }
TClumsyCrucible = class(TSolver)
public
procedure ProcessDataLine(const ALine: string); override;
procedure Finish; override;
function GetDataFileName: string; override;
function GetPuzzleName: string; override;
end;
implementation
{ TClumsyCrucible }
procedure TClumsyCrucible.ProcessDataLine(const ALine: string);
begin
end;
procedure TClumsyCrucible.Finish;
begin
end;
function TClumsyCrucible.GetDataFileName: string;
begin
Result := 'clumsy_crucible.txt';
end;
function TClumsyCrucible.GetPuzzleName: string;
begin
Result := 'Day 17: Clumsy Crucible';
end;
end.

View File

@ -0,0 +1,64 @@
{
Solutions to the Advent Of Code.
Copyright (C) 2023 Stefan Müller
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
}
unit ULavaductLagoon;
{$mode ObjFPC}{$H+}
interface
uses
Classes, SysUtils, USolver;
type
{ TLavaductLagoon }
TLavaductLagoon = class(TSolver)
public
procedure ProcessDataLine(const ALine: string); override;
procedure Finish; override;
function GetDataFileName: string; override;
function GetPuzzleName: string; override;
end;
implementation
{ TLavaductLagoon }
procedure TLavaductLagoon.ProcessDataLine(const ALine: string);
begin
end;
procedure TLavaductLagoon.Finish;
begin
end;
function TLavaductLagoon.GetDataFileName: string;
begin
Result := 'lavaduct_lagoon.txt';
end;
function TLavaductLagoon.GetPuzzleName: string;
begin
Result := 'Day 18: Lavaduct Lagoon';
end;
end.

View File

@ -108,6 +108,18 @@
<Filename Value="UFloorWillBeLavaTestCases.pas"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="UClumsyCrucibleTestCases.pas"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="ULavaductLagoonTestCases.pas"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="UAplentyTestCases.pas"/>
<IsPartOfProject Value="True"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>

View File

@ -7,7 +7,7 @@ uses
UGearRatiosTestCases, UScratchcardsTestCases, UGiveSeedFertilizerTestCases, UWaitForItTestCases, UCamelCardsTestCases,
UHauntedWastelandTestCases, UMirageMaintenanceTestCases, UPipeMazeTestCases, UCosmicExpansionTestCases,
UHotSpringsTestCases, UPointOfIncidenceTestCases, UParabolicReflectorDishTestCases, ULensLibraryTestCases,
UFloorWillBeLavaTestCases;
UFloorWillBeLavaTestCases, UClumsyCrucibleTestCases, ULavaductLagoonTestCases, UAplentyTestCases;
{$R *.res}

View File

@ -0,0 +1,90 @@
{
Solutions to the Advent Of Code.
Copyright (C) 2023 Stefan Müller
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
}
unit UAplentyTestCases;
{$mode ObjFPC}{$H+}
interface
uses
Classes, SysUtils, fpcunit, testregistry, USolver, UBaseTestCases, UAplenty;
type
{ TAplentyFullDataTestCase }
TAplentyFullDataTestCase = class(TEngineBaseTest)
protected
function CreateSolver: ISolver; override;
published
procedure TestPart1;
procedure TestPart2;
end;
{ TAplentyExampleTestCase }
TAplentyExampleTestCase = class(TExampleEngineBaseTest)
protected
function CreateSolver: ISolver; override;
published
procedure TestPart1;
procedure TestPart2;
end;
implementation
{ TAplentyFullDataTestCase }
function TAplentyFullDataTestCase.CreateSolver: ISolver;
begin
Result := TAplenty.Create;
end;
procedure TAplentyFullDataTestCase.TestPart1;
begin
AssertEquals(-1, FSolver.GetResultPart1);
end;
procedure TAplentyFullDataTestCase.TestPart2;
begin
AssertEquals(-1, FSolver.GetResultPart2);
end;
{ TAplentyExampleTestCase }
function TAplentyExampleTestCase.CreateSolver: ISolver;
begin
Result := TAplenty.Create;
end;
procedure TAplentyExampleTestCase.TestPart1;
begin
AssertEquals(19114, FSolver.GetResultPart1);
end;
procedure TAplentyExampleTestCase.TestPart2;
begin
AssertEquals(-1, FSolver.GetResultPart2);
end;
initialization
RegisterTest(TAplentyFullDataTestCase);
RegisterTest(TAplentyExampleTestCase);
end.

View File

@ -0,0 +1,90 @@
{
Solutions to the Advent Of Code.
Copyright (C) 2023 Stefan Müller
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
}
unit UClumsyCrucibleTestCases;
{$mode ObjFPC}{$H+}
interface
uses
Classes, SysUtils, fpcunit, testregistry, USolver, UBaseTestCases, UClumsyCrucible;
type
{ TClumsyCrucibleFullDataTestCase }
TClumsyCrucibleFullDataTestCase = class(TEngineBaseTest)
protected
function CreateSolver: ISolver; override;
published
procedure TestPart1;
procedure TestPart2;
end;
{ TClumsyCrucibleExampleTestCase }
TClumsyCrucibleExampleTestCase = class(TExampleEngineBaseTest)
protected
function CreateSolver: ISolver; override;
published
procedure TestPart1;
procedure TestPart2;
end;
implementation
{ TClumsyCrucibleFullDataTestCase }
function TClumsyCrucibleFullDataTestCase.CreateSolver: ISolver;
begin
Result := TClumsyCrucible.Create;
end;
procedure TClumsyCrucibleFullDataTestCase.TestPart1;
begin
AssertEquals(-1, FSolver.GetResultPart1);
end;
procedure TClumsyCrucibleFullDataTestCase.TestPart2;
begin
AssertEquals(-1, FSolver.GetResultPart2);
end;
{ TClumsyCrucibleExampleTestCase }
function TClumsyCrucibleExampleTestCase.CreateSolver: ISolver;
begin
Result := TClumsyCrucible.Create;
end;
procedure TClumsyCrucibleExampleTestCase.TestPart1;
begin
AssertEquals(102, FSolver.GetResultPart1);
end;
procedure TClumsyCrucibleExampleTestCase.TestPart2;
begin
AssertEquals(-1, FSolver.GetResultPart2);
end;
initialization
RegisterTest(TClumsyCrucibleFullDataTestCase);
RegisterTest(TClumsyCrucibleExampleTestCase);
end.

View File

@ -0,0 +1,90 @@
{
Solutions to the Advent Of Code.
Copyright (C) 2023 Stefan Müller
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
}
unit ULavaductLagoonTestCases;
{$mode ObjFPC}{$H+}
interface
uses
Classes, SysUtils, fpcunit, testregistry, USolver, UBaseTestCases, ULavaductLagoon;
type
{ TLavaductLagoonFullDataTestCase }
TLavaductLagoonFullDataTestCase = class(TEngineBaseTest)
protected
function CreateSolver: ISolver; override;
published
procedure TestPart1;
procedure TestPart2;
end;
{ TLavaductLagoonExampleTestCase }
TLavaductLagoonExampleTestCase = class(TExampleEngineBaseTest)
protected
function CreateSolver: ISolver; override;
published
procedure TestPart1;
procedure TestPart2;
end;
implementation
{ TLavaductLagoonFullDataTestCase }
function TLavaductLagoonFullDataTestCase.CreateSolver: ISolver;
begin
Result := TLavaductLagoon.Create;
end;
procedure TLavaductLagoonFullDataTestCase.TestPart1;
begin
AssertEquals(-1, FSolver.GetResultPart1);
end;
procedure TLavaductLagoonFullDataTestCase.TestPart2;
begin
AssertEquals(-1, FSolver.GetResultPart2);
end;
{ TLavaductLagoonExampleTestCase }
function TLavaductLagoonExampleTestCase.CreateSolver: ISolver;
begin
Result := TLavaductLagoon.Create;
end;
procedure TLavaductLagoonExampleTestCase.TestPart1;
begin
AssertEquals(62, FSolver.GetResultPart1);
end;
procedure TLavaductLagoonExampleTestCase.TestPart2;
begin
AssertEquals(-1, FSolver.GetResultPart2);
end;
initialization
RegisterTest(TLavaductLagoonFullDataTestCase);
RegisterTest(TLavaductLagoonExampleTestCase);
end.