Day2Part1

This commit is contained in:
Feiko Wielsma 2025-12-03 21:28:53 +00:00
parent 86dcbd3aaf
commit 5d1d878d78
7 changed files with 117 additions and 18 deletions

View file

@ -1,11 +1,2 @@
add_executable(day1 main.cpp)
set_target_properties(day1 PROPERTIES CXX_STANDARD 23 CXX_STANDARD_REQUIRED ON)
# Use GCC 15's libstdc++ with Clang 21
target_compile_options(day1 PRIVATE --gcc-toolchain=/usr)
add_custom_command(TARGET day1 POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/day1_input
$<TARGET_FILE_DIR:day1>/day1_input
COMMENT "Copying day1_input to build directory"
)
# Use top-level helper to add the target and copy input files
aoc_add_day(day1 "${CMAKE_CURRENT_SOURCE_DIR}" main.cpp)

View file

@ -67,10 +67,6 @@ auto executeSafeCrack(const std::vector<DialRotation>& dialRotations){
}
}
std::println("{} : {:3}, Dial now at: {:5} cnt: {}", curDial.direction, curDial.distance, dial, countZero);
if (dial < 0){
std::cout << "Shit's fucked!\n";
@ -86,7 +82,6 @@ auto executeSafeCrack(const std::vector<DialRotation>& dialRotations){
}
auto main(int, char**) -> int {
std::cout << "Hello, from aoc25 day1!!\n";
auto retval = parseRotations("day1_input");
std::vector<DialRotation> testCase = {
@ -103,8 +98,7 @@ auto main(int, char**) -> int {
{'L', 1000},
};
if(retval)
{
if(retval) {
auto realResult = executeSafeCrack(*retval);
auto result = executeSafeCrack(testCase);
std::println("Testcase result: {}", result);