AdventOfCode2024/src/Program.cpp

85 lines
2.7 KiB
C++

// Solutions to the Advent Of Code 2024.
// Copyright (C) 2024-2025 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/>.
#include <aoc/Program.hpp>
#include <iostream>
#include <memory>
#include <aoc/framework/SolverEngine.hpp>
// Solver implementations in day order.
#include <aoc/HistorianHysteria.hpp>
#include <aoc/RedNosedReports.hpp>
#include <aoc/MullItOver.hpp>
#include <aoc/CeresSearch.hpp>
#include <aoc/PrintQueue.hpp>
#include <aoc/GuardGallivant.hpp>
#include <aoc/BridgeRepair.hpp>
#include <aoc/ResonantCollinearity.hpp>
#include <aoc/DiskFragmenter.hpp>
#include <aoc/HoofIt.hpp>
#include <aoc/PlutonianPebbles.hpp>
#include <aoc/GardenGroups.hpp>
#include <aoc/ClawContraption.hpp>
#include <aoc/RestroomRedoubt.hpp>
#include <aoc/WarehouseWoes.hpp>
#include <aoc/ReindeerMaze.hpp>
#include <aoc/ChronospatialComputer.hpp>
#include <aoc/RamRun.hpp>
#include <aoc/LanParty.hpp>
void Program::run()
{
std::cout << "### Advent of Code 2024 ###\n";
runSolvers();
}
template <class T>
void runSolver(SolverEngine& solverEngine)
{
auto solver = std::make_unique<T>();
solverEngine.run(*solver);
}
void Program::runSolvers()
{
SolverEngine solverEngine{ getInputPaths() };
runSolver<HistorianHysteria>(solverEngine);
runSolver<RedNosedReports>(solverEngine);
runSolver<MullItOver>(solverEngine);
runSolver<CeresSearch>(solverEngine);
runSolver<PrintQueue>(solverEngine);
runSolver<GuardGallivant>(solverEngine);
runSolver<BridgeRepair>(solverEngine);
runSolver<ResonantCollinearity>(solverEngine);
runSolver<DiskFragmenter>(solverEngine);
runSolver<HoofIt>(solverEngine);
runSolver<PlutonianPebbles>(solverEngine);
runSolver<GardenGroups>(solverEngine);
runSolver<ClawContraption>(solverEngine);
runSolver<RestroomRedoubt>(solverEngine);
runSolver<WarehouseWoes>(solverEngine);
runSolver<ReindeerMaze>(solverEngine);
runSolver<ChronospatialComputer>(solverEngine);
runSolver<RamRun>(solverEngine);
runSolver<LanParty>(solverEngine);
}
std::vector<std::string> Program::getInputPaths() const
{
return std::vector<std::string>{ "data", "../../../data", "../../../../data" };
}