From e778c916b64e4d658ff8a5b9348aee4ecb4be1aa Mon Sep 17 00:00:00 2001 From: Stedd Date: Sun, 1 Dec 2024 14:59:32 +0100 Subject: [PATCH] restructured for part 2 --- days/day01.cpp | 6 +++--- days/day01.h | 3 ++- main.cpp | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/days/day01.cpp b/days/day01.cpp index ab8f583..ebc0e1a 100644 --- a/days/day01.cpp +++ b/days/day01.cpp @@ -73,14 +73,14 @@ you found. In the example above, this is 2 + 1 + 0 + 1 + 2 + 5, a total distance Your actual left and right lists contain many location IDs. What is the total distance between your lists? */ -void day01::Run() +void day01::Part1() { std::vector col1; std::vector col2; int sum = 0; - std::ifstream input("input/day01.txt"); - //std::ifstream input("input/day01short.txt"); + // std::ifstream input("input/day01.txt"); + std::ifstream input("input/day01short.txt"); if (!input) { diff --git a/days/day01.h b/days/day01.h index f55f5cb..368d9f8 100644 --- a/days/day01.h +++ b/days/day01.h @@ -9,7 +9,8 @@ class day01 { public: - static void Run(); + static void Part1(); + static void Part2(); }; diff --git a/main.cpp b/main.cpp index a5784d8..a2595e2 100644 --- a/main.cpp +++ b/main.cpp @@ -6,7 +6,7 @@ int main() { const auto startTime = std::chrono::high_resolution_clock::now(); - day01::Run(); + day01::Part2(); const auto endTime = std::chrono::high_resolution_clock::now(); const std::chrono::duration diff = endTime - startTime; std::cout << "Execution time: " << diff.count() * 1e6 << " μs" << std::endl;