commit 832cd997b3011e5fa1593a3ef2b2a636a86ada2d Author: Hugo MÄrdbrink Date: Wed Nov 20 10:45:02 2024 +0100 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1790c52 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.DS_Store +/build +d*/.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..33f8281 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,36 @@ +cmake_minimum_required(VERSION 3.9) +project(aoc24 LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 23) + +set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/build) +set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}) + +set(CMAKE_CXX_COMPILER clang++) + +set(CMAKE_BUILD_TYPE Release) + +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3") +endif() + +set(executables d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 d21 d22 d23 d24 d25) + +foreach(executable ${executables}) + file(GLOB_RECURSE sources ${executable}/*.cxx ${executable}/*.hxx) + add_executable(${executable} ${sources}) +endforeach() + +# For brute forcing +find_package(OpenMP) +if(OpenMP_CXX_FOUND) + foreach(executable ${executables}) + target_link_libraries(${executable} PUBLIC OpenMP::OpenMP_CXX) + endforeach() +endif() + +set(CMAKE_CXX_CLANG_TIDY + clang-tidy; + -checks=*; + -header-filter=.*; +) diff --git a/README.md b/README.md new file mode 100644 index 0000000..ad4ba57 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# AOC 24 + +In C++ + +## Build +```bash +mkdir build +cd build +cmake .. +make +``` diff --git a/d1/main.cxx b/d1/main.cxx new file mode 100644 index 0000000..be50c78 --- /dev/null +++ b/d1/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d1/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +} diff --git a/d10/main.cxx b/d10/main.cxx new file mode 100644 index 0000000..5ff286e --- /dev/null +++ b/d10/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d10/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +} diff --git a/d11/main.cxx b/d11/main.cxx new file mode 100644 index 0000000..0cb5d99 --- /dev/null +++ b/d11/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d11/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +} diff --git a/d12/main.cxx b/d12/main.cxx new file mode 100644 index 0000000..e7ba6b8 --- /dev/null +++ b/d12/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d12/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +} diff --git a/d13/main.cxx b/d13/main.cxx new file mode 100644 index 0000000..252338e --- /dev/null +++ b/d13/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d13/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +} diff --git a/d14/main.cxx b/d14/main.cxx new file mode 100644 index 0000000..48dafe6 --- /dev/null +++ b/d14/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d14/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +} diff --git a/d15/main.cxx b/d15/main.cxx new file mode 100644 index 0000000..74bf743 --- /dev/null +++ b/d15/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d15/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +} diff --git a/d16/main.cxx b/d16/main.cxx new file mode 100644 index 0000000..eee8976 --- /dev/null +++ b/d16/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d16/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +} diff --git a/d17/main.cxx b/d17/main.cxx new file mode 100644 index 0000000..a52d327 --- /dev/null +++ b/d17/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d17/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +} diff --git a/d18/main.cxx b/d18/main.cxx new file mode 100644 index 0000000..dd9f8df --- /dev/null +++ b/d18/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d18/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +} diff --git a/d19/main.cxx b/d19/main.cxx new file mode 100644 index 0000000..5ef23dd --- /dev/null +++ b/d19/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d19/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +} diff --git a/d2/main.cxx b/d2/main.cxx new file mode 100644 index 0000000..35a8815 --- /dev/null +++ b/d2/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d2/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +} diff --git a/d20/main.cxx b/d20/main.cxx new file mode 100644 index 0000000..9654a2a --- /dev/null +++ b/d20/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d20/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +} diff --git a/d21/main.cxx b/d21/main.cxx new file mode 100644 index 0000000..01c68fd --- /dev/null +++ b/d21/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d21/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +} diff --git a/d22/main.cxx b/d22/main.cxx new file mode 100644 index 0000000..745f20c --- /dev/null +++ b/d22/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d22/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +} diff --git a/d23/main.cxx b/d23/main.cxx new file mode 100644 index 0000000..21c8c18 --- /dev/null +++ b/d23/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d23/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +} diff --git a/d24/main.cxx b/d24/main.cxx new file mode 100644 index 0000000..c7d6f76 --- /dev/null +++ b/d24/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d24/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +} diff --git a/d25/main.cxx b/d25/main.cxx new file mode 100644 index 0000000..1676c13 --- /dev/null +++ b/d25/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d25/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +} diff --git a/d3/main.cxx b/d3/main.cxx new file mode 100644 index 0000000..a69ad40 --- /dev/null +++ b/d3/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d3/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +} diff --git a/d4/main.cxx b/d4/main.cxx new file mode 100644 index 0000000..b664657 --- /dev/null +++ b/d4/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d4/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +} diff --git a/d5/main.cxx b/d5/main.cxx new file mode 100644 index 0000000..1d2c7c2 --- /dev/null +++ b/d5/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d5/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +} diff --git a/d6/main.cxx b/d6/main.cxx new file mode 100644 index 0000000..0470627 --- /dev/null +++ b/d6/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d6/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +} diff --git a/d7/main.cxx b/d7/main.cxx new file mode 100644 index 0000000..12f5684 --- /dev/null +++ b/d7/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d7/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +} diff --git a/d8/main.cxx b/d8/main.cxx new file mode 100644 index 0000000..2b56230 --- /dev/null +++ b/d8/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d8/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +} diff --git a/d9/main.cxx b/d9/main.cxx new file mode 100644 index 0000000..3dff4c0 --- /dev/null +++ b/d9/main.cxx @@ -0,0 +1,15 @@ +#include +#include + +using std::cout, std::endl; + +int main() { + std::ifstream file{"../d9/input.txt"}; + std::string line; + + while (std::getline(file, line)) { + + } + + return 0; +}