diff --git a/.gitattributes b/.gitattributes index 588506e..1f869c3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -inc/* linguist-vendored +2020/inc/* linguist-vendored diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2f523c7..201a10f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,7 +15,8 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE - uses: actions/checkout@v2 - - name: Compile and run + - name: Compile and run AoC2020 run: | + cd 2020 ./build/make.sh time ./cmake-build-release/adventofcode diff --git a/2020/.gitignore b/2020/.gitignore new file mode 100644 index 0000000..8eee68f --- /dev/null +++ b/2020/.gitignore @@ -0,0 +1 @@ +cmake-build-* diff --git a/2020/.idea/.gitignore b/2020/.idea/.gitignore new file mode 100644 index 0000000..73f69e0 --- /dev/null +++ b/2020/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/2020/.idea/adventofcode.iml b/2020/.idea/adventofcode.iml new file mode 100644 index 0000000..f08604b --- /dev/null +++ b/2020/.idea/adventofcode.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/2020/.idea/misc.xml b/2020/.idea/misc.xml new file mode 100644 index 0000000..aab6f43 --- /dev/null +++ b/2020/.idea/misc.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/2020/.idea/modules.xml b/2020/.idea/modules.xml new file mode 100644 index 0000000..b27311f --- /dev/null +++ b/2020/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/2020/.idea/vcs.xml b/2020/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/2020/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/2020/.vscode/c_cpp_properties.json b/2020/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..13a765d --- /dev/null +++ b/2020/.vscode/c_cpp_properties.json @@ -0,0 +1,15 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [], + "compilerPath": "/usr/bin/g++", + "cppStandard": "c++17", + "intelliSenseMode": "${default}" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/2020/.vscode/launch.json b/2020/.vscode/launch.json new file mode 100644 index 0000000..dec8988 --- /dev/null +++ b/2020/.vscode/launch.json @@ -0,0 +1,22 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Build and debug", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/cmake-build-debug/adventofcode", + "cwd": "${workspaceFolder}", + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ], + "preLaunchTask": "Build (Debug)", + "miDebuggerPath": "/usr/bin/gdb" + } + ] +} \ No newline at end of file diff --git a/2020/.vscode/settings.json b/2020/.vscode/settings.json new file mode 100644 index 0000000..552699a --- /dev/null +++ b/2020/.vscode/settings.json @@ -0,0 +1,59 @@ +{ + "files.exclude": { + ".vscode/**": true, + ".idea/**": true, + ".github/**": true, + ".gitignore": true, + ".gitattributes": true, + "cmake-build-*/**": true + }, + "C_Cpp.errorSquiggles": "Enabled", + "files.associations": { + "iostream": "cpp", + "algorithm": "cpp", + "sstream": "cpp", + "array": "cpp", + "atomic": "cpp", + "bit": "cpp", + "*.tcc": "cpp", + "cctype": "cpp", + "clocale": "cpp", + "cmath": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdint": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cwchar": "cpp", + "cwctype": "cpp", + "deque": "cpp", + "unordered_map": "cpp", + "vector": "cpp", + "exception": "cpp", + "functional": "cpp", + "iterator": "cpp", + "memory": "cpp", + "memory_resource": "cpp", + "numeric": "cpp", + "optional": "cpp", + "random": "cpp", + "string": "cpp", + "string_view": "cpp", + "system_error": "cpp", + "tuple": "cpp", + "type_traits": "cpp", + "utility": "cpp", + "fstream": "cpp", + "initializer_list": "cpp", + "iosfwd": "cpp", + "istream": "cpp", + "limits": "cpp", + "new": "cpp", + "ostream": "cpp", + "stdexcept": "cpp", + "streambuf": "cpp", + "typeinfo": "cpp", + "future": "cpp", + "stop_token": "cpp" + } +} diff --git a/2020/.vscode/tasks.json b/2020/.vscode/tasks.json new file mode 100644 index 0000000..f4dc10a --- /dev/null +++ b/2020/.vscode/tasks.json @@ -0,0 +1,82 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "type": "shell", + "label": "Configure (Debug)", + "command": "/usr/bin/cmake", + "args": [ + "-DCMAKE_BUILD_TYPE=Debug", + "-B./cmake-build-debug" + ], + "problemMatcher": [], + "group": "build", + "presentation": { + "clear": true, + "showReuseMessage": false + } + }, + { + "type": "shell", + "label": "Build (Debug)", + "command": "/usr/bin/cmake", + "args": [ + "--build", + "./cmake-build-debug", + "--target", + "all", + "--", + "-j", + "9" + ], + "problemMatcher": [ + "$gcc" + ], + "group": { + "kind": "build", + "isDefault": true + }, + "presentation": { + "clear": true, + "showReuseMessage": false + } + }, + { + "type": "shell", + "label": "Configure (Release)", + "command": "/usr/bin/cmake", + "args": [ + "-DCMAKE_BUILD_TYPE=Release", + "-B./cmake-build-release" + ], + "problemMatcher": [], + "group": "build", + "presentation": { + "clear": true, + "showReuseMessage": false + } + }, + { + "type": "shell", + "label": "Build (Release)", + "command": "/usr/bin/cmake", + "args": [ + "--build", + "./cmake-build-release", + "--target", + "all", + "--", + "-j", + "9" + ], + "problemMatcher": [ + "$gcc" + ], + "group": "build", + "presentation": { + "clear": true, + "showReuseMessage": false + } + } + ] +} diff --git a/CMakeLists.txt b/2020/CMakeLists.txt similarity index 100% rename from CMakeLists.txt rename to 2020/CMakeLists.txt diff --git a/2020/README.md b/2020/README.md new file mode 100644 index 0000000..c7c6b2d --- /dev/null +++ b/2020/README.md @@ -0,0 +1,39 @@ +# Advent of Code 2020 C++ + +From . Better late than never ;) + +## System requirements + +- build-essentials (gcc) +- cmake + +Only Linux/gcc has been tested. Other platforms might just work though. + +## Compile & run (Release) + +```bash +./build/make.sh +./cmake-build-release/adventofcode +``` + +The command line arguments from apply to the executable, e.g. use `./cmake-build-release/adventofcode --success "Day 01 - Part 1*"` to run a single test only including showing verbose test results. + +## Recompile & run (Debug) + +```bash +./build/run.sh +``` + +The command line arguments for the test runner (see above) are passed by the `run.sh` script to the executable. + +## Results + +Enjoying all the stars... + +![Final AoC map](https://github.com/jp7677/adventofcode/raw/main/map.png) + +## Other cool solutions + +- +- +- diff --git a/build/make.sh b/2020/build/make.sh similarity index 100% rename from build/make.sh rename to 2020/build/make.sh diff --git a/build/run.sh b/2020/build/run.sh similarity index 100% rename from build/run.sh rename to 2020/build/run.sh diff --git a/data/day01-input.txt b/2020/data/day01-input.txt similarity index 100% rename from data/day01-input.txt rename to 2020/data/day01-input.txt diff --git a/data/day02-input.txt b/2020/data/day02-input.txt similarity index 100% rename from data/day02-input.txt rename to 2020/data/day02-input.txt diff --git a/data/day03-input.txt b/2020/data/day03-input.txt similarity index 100% rename from data/day03-input.txt rename to 2020/data/day03-input.txt diff --git a/data/day04-input.txt b/2020/data/day04-input.txt similarity index 100% rename from data/day04-input.txt rename to 2020/data/day04-input.txt diff --git a/data/day05-input.txt b/2020/data/day05-input.txt similarity index 100% rename from data/day05-input.txt rename to 2020/data/day05-input.txt diff --git a/data/day06-input.txt b/2020/data/day06-input.txt similarity index 100% rename from data/day06-input.txt rename to 2020/data/day06-input.txt diff --git a/data/day07-input.txt b/2020/data/day07-input.txt similarity index 100% rename from data/day07-input.txt rename to 2020/data/day07-input.txt diff --git a/data/day08-input.txt b/2020/data/day08-input.txt similarity index 100% rename from data/day08-input.txt rename to 2020/data/day08-input.txt diff --git a/data/day09-input.txt b/2020/data/day09-input.txt similarity index 100% rename from data/day09-input.txt rename to 2020/data/day09-input.txt diff --git a/data/day10-input.txt b/2020/data/day10-input.txt similarity index 100% rename from data/day10-input.txt rename to 2020/data/day10-input.txt diff --git a/data/day11-input.txt b/2020/data/day11-input.txt similarity index 100% rename from data/day11-input.txt rename to 2020/data/day11-input.txt diff --git a/data/day12-input.txt b/2020/data/day12-input.txt similarity index 100% rename from data/day12-input.txt rename to 2020/data/day12-input.txt diff --git a/data/day13-input.txt b/2020/data/day13-input.txt similarity index 100% rename from data/day13-input.txt rename to 2020/data/day13-input.txt diff --git a/data/day14-input.txt b/2020/data/day14-input.txt similarity index 100% rename from data/day14-input.txt rename to 2020/data/day14-input.txt diff --git a/data/day15-input.txt b/2020/data/day15-input.txt similarity index 100% rename from data/day15-input.txt rename to 2020/data/day15-input.txt diff --git a/data/day16-input.txt b/2020/data/day16-input.txt similarity index 100% rename from data/day16-input.txt rename to 2020/data/day16-input.txt diff --git a/data/day17-input.txt b/2020/data/day17-input.txt similarity index 100% rename from data/day17-input.txt rename to 2020/data/day17-input.txt diff --git a/data/day18-input.txt b/2020/data/day18-input.txt similarity index 100% rename from data/day18-input.txt rename to 2020/data/day18-input.txt diff --git a/data/day19-input.txt b/2020/data/day19-input.txt similarity index 100% rename from data/day19-input.txt rename to 2020/data/day19-input.txt diff --git a/data/day20-input.txt b/2020/data/day20-input.txt similarity index 100% rename from data/day20-input.txt rename to 2020/data/day20-input.txt diff --git a/data/day21-input.txt b/2020/data/day21-input.txt similarity index 100% rename from data/day21-input.txt rename to 2020/data/day21-input.txt diff --git a/data/day22-input.txt b/2020/data/day22-input.txt similarity index 100% rename from data/day22-input.txt rename to 2020/data/day22-input.txt diff --git a/data/day23-input.txt b/2020/data/day23-input.txt similarity index 100% rename from data/day23-input.txt rename to 2020/data/day23-input.txt diff --git a/data/day24-input.txt b/2020/data/day24-input.txt similarity index 100% rename from data/day24-input.txt rename to 2020/data/day24-input.txt diff --git a/data/day25-input.txt b/2020/data/day25-input.txt similarity index 100% rename from data/day25-input.txt rename to 2020/data/day25-input.txt diff --git a/inc/catch.hpp b/2020/inc/catch.hpp similarity index 100% rename from inc/catch.hpp rename to 2020/inc/catch.hpp diff --git a/map.png b/2020/map.png similarity index 100% rename from map.png rename to 2020/map.png diff --git a/src/day01.cpp b/2020/src/day01.cpp similarity index 100% rename from src/day01.cpp rename to 2020/src/day01.cpp diff --git a/src/day02.cpp b/2020/src/day02.cpp similarity index 100% rename from src/day02.cpp rename to 2020/src/day02.cpp diff --git a/src/day03.cpp b/2020/src/day03.cpp similarity index 100% rename from src/day03.cpp rename to 2020/src/day03.cpp diff --git a/src/day04.cpp b/2020/src/day04.cpp similarity index 100% rename from src/day04.cpp rename to 2020/src/day04.cpp diff --git a/src/day05.cpp b/2020/src/day05.cpp similarity index 100% rename from src/day05.cpp rename to 2020/src/day05.cpp diff --git a/src/day06.cpp b/2020/src/day06.cpp similarity index 100% rename from src/day06.cpp rename to 2020/src/day06.cpp diff --git a/src/day07.cpp b/2020/src/day07.cpp similarity index 100% rename from src/day07.cpp rename to 2020/src/day07.cpp diff --git a/src/day08.cpp b/2020/src/day08.cpp similarity index 100% rename from src/day08.cpp rename to 2020/src/day08.cpp diff --git a/src/day09.cpp b/2020/src/day09.cpp similarity index 100% rename from src/day09.cpp rename to 2020/src/day09.cpp diff --git a/src/day10.cpp b/2020/src/day10.cpp similarity index 100% rename from src/day10.cpp rename to 2020/src/day10.cpp diff --git a/src/day11.cpp b/2020/src/day11.cpp similarity index 100% rename from src/day11.cpp rename to 2020/src/day11.cpp diff --git a/src/day12.cpp b/2020/src/day12.cpp similarity index 100% rename from src/day12.cpp rename to 2020/src/day12.cpp diff --git a/src/day13.cpp b/2020/src/day13.cpp similarity index 100% rename from src/day13.cpp rename to 2020/src/day13.cpp diff --git a/src/day14.cpp b/2020/src/day14.cpp similarity index 100% rename from src/day14.cpp rename to 2020/src/day14.cpp diff --git a/src/day15.cpp b/2020/src/day15.cpp similarity index 100% rename from src/day15.cpp rename to 2020/src/day15.cpp diff --git a/src/day16.cpp b/2020/src/day16.cpp similarity index 100% rename from src/day16.cpp rename to 2020/src/day16.cpp diff --git a/src/day17.cpp b/2020/src/day17.cpp similarity index 100% rename from src/day17.cpp rename to 2020/src/day17.cpp diff --git a/src/day18.cpp b/2020/src/day18.cpp similarity index 100% rename from src/day18.cpp rename to 2020/src/day18.cpp diff --git a/src/day19.cpp b/2020/src/day19.cpp similarity index 100% rename from src/day19.cpp rename to 2020/src/day19.cpp diff --git a/src/day20.cpp b/2020/src/day20.cpp similarity index 100% rename from src/day20.cpp rename to 2020/src/day20.cpp diff --git a/src/day21.cpp b/2020/src/day21.cpp similarity index 100% rename from src/day21.cpp rename to 2020/src/day21.cpp diff --git a/src/day22.cpp b/2020/src/day22.cpp similarity index 100% rename from src/day22.cpp rename to 2020/src/day22.cpp diff --git a/src/day23.cpp b/2020/src/day23.cpp similarity index 100% rename from src/day23.cpp rename to 2020/src/day23.cpp diff --git a/src/day24.cpp b/2020/src/day24.cpp similarity index 100% rename from src/day24.cpp rename to 2020/src/day24.cpp diff --git a/src/day25.cpp b/2020/src/day25.cpp similarity index 100% rename from src/day25.cpp rename to 2020/src/day25.cpp diff --git a/src/days_private.h b/2020/src/days_private.h similarity index 100% rename from src/days_private.h rename to 2020/src/days_private.h diff --git a/src/main.cpp b/2020/src/main.cpp similarity index 100% rename from src/main.cpp rename to 2020/src/main.cpp diff --git a/src/util.h b/2020/src/util.h similarity index 100% rename from src/util.h rename to 2020/src/util.h diff --git a/README.md b/README.md index c7c6b2d..b6671b4 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,9 @@ -# Advent of Code 2020 C++ +# Advent of Code -From . Better late than never ;) +From . Better late than never ;) -## System requirements +## The years -- build-essentials (gcc) -- cmake +- Advent of Code 2020 C++ -Only Linux/gcc has been tested. Other platforms might just work though. - -## Compile & run (Release) - -```bash -./build/make.sh -./cmake-build-release/adventofcode -``` - -The command line arguments from apply to the executable, e.g. use `./cmake-build-release/adventofcode --success "Day 01 - Part 1*"` to run a single test only including showing verbose test results. - -## Recompile & run (Debug) - -```bash -./build/run.sh -``` - -The command line arguments for the test runner (see above) are passed by the `run.sh` script to the executable. - -## Results - -Enjoying all the stars... - -![Final AoC map](https://github.com/jp7677/adventofcode/raw/main/map.png) - -## Other cool solutions - -- -- -- +Enjoy the stars...