diff --git a/.gitignore b/.gitignore deleted file mode 100644 index e811397..0000000 --- a/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -/.idea/compiler.xml -/.idea/dictionaries -/.idea/encodings.xml -/.idea/gradle.xml -/.idea/inspectionProfiles/ -/.idea/jarRepositories.xml -/.idea/modules.xml -/.idea/vcs.xml -/.idea/*.iml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 26d3352..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index 270fdbb..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -AdventOfCode diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 3a21aba..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$/2015"> - <contentRoot DIR="$PROJECT_DIR$" /> - </component> - <component name="CidrRootsConfiguration"> - <sourceRoots> - <file path="$PROJECT_DIR$/2015" /> - <file path="$PROJECT_DIR$/2020" /> - </sourceRoots> - <excludeRoots> - <file path="$PROJECT_DIR$/.gradle" /> - <file path="$PROJECT_DIR$/2020/target" /> - <file path="$PROJECT_DIR$/2021" /> - <file path="$PROJECT_DIR$/build" /> - <file path="$PROJECT_DIR$/gradle" /> - </excludeRoots> - </component> - <component name="CodeInsightWorkspaceSettings"> - <option name="optimizeImportsOnTheFly" value="true" /> - </component> - <component name="ComposerSettings"> - <execution /> - </component> - <component name="ExternalStorageConfigurationManager" enabled="true" /> - <component name="JsFlowSettings"> - <service-enabled>true</service-enabled> - <exe-path /> - <other-services-enabled>true</other-services-enabled> - <auto-save>true</auto-save> - </component> - <component name="PhpProjectSharedConfiguration" php_language_level="7.4" /> - <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK" /> -</project> \ No newline at end of file diff --git a/.idea/runConfigurations/2015___Day_01.xml b/.idea/runConfigurations/2015___Day_01.xml deleted file mode 100644 index 54224e8..0000000 --- a/.idea/runConfigurations/2015___Day_01.xml +++ /dev/null @@ -1,7 +0,0 @@ -<component name="ProjectRunConfigurationManager"> - <configuration default="false" name="2015 - Day 01" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$PROJECT_DIR$/2015/01" PASS_PARENT_ENVS_2="true" PROJECT_NAME="AOC" TARGET_NAME="AOC_2015_01" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="AOC" RUN_TARGET_NAME="AOC_2015_01"> - <method v="2"> - <option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" /> - </method> - </configuration> -</component> \ No newline at end of file diff --git a/.idea/runConfigurations/2015___Day_02.xml b/.idea/runConfigurations/2015___Day_02.xml deleted file mode 100644 index 318ff85..0000000 --- a/.idea/runConfigurations/2015___Day_02.xml +++ /dev/null @@ -1,7 +0,0 @@ -<component name="ProjectRunConfigurationManager"> - <configuration default="false" name="2015 - Day 02" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$PROJECT_DIR$/2015/02" PASS_PARENT_ENVS_2="true" PROJECT_NAME="AOC" TARGET_NAME="AOC_2015_02" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="AOC" RUN_TARGET_NAME="AOC_2015_02"> - <method v="2"> - <option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" /> - </method> - </configuration> -</component> \ No newline at end of file diff --git a/.idea/runConfigurations/2015___Day_03.xml b/.idea/runConfigurations/2015___Day_03.xml deleted file mode 100644 index f77dfb5..0000000 --- a/.idea/runConfigurations/2015___Day_03.xml +++ /dev/null @@ -1,7 +0,0 @@ -<component name="ProjectRunConfigurationManager"> - <configuration default="false" name="2015 - Day 03" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$PROJECT_DIR$/2015/03" PASS_PARENT_ENVS_2="true" PROJECT_NAME="AOC" TARGET_NAME="AOC_2015_03" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="AOC" RUN_TARGET_NAME="AOC_2015_03"> - <method v="2"> - <option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" /> - </method> - </configuration> -</component> \ No newline at end of file diff --git a/2015/.gitignore b/2015/.gitignore index 4475b96..b107940 100644 --- a/2015/.gitignore +++ b/2015/.gitignore @@ -1,2 +1,7 @@ +/.idea/* +!/.idea/cmake.xml +!/.idea/misc.xml +!/.idea/runConfigurations + /cmake-build-debug/ /cmake-build-release/ diff --git a/.idea/cmake.xml b/2015/.idea/cmake.xml similarity index 100% rename from .idea/cmake.xml rename to 2015/.idea/cmake.xml diff --git a/2015/.idea/misc.xml b/2015/.idea/misc.xml new file mode 100644 index 0000000..f56b972 --- /dev/null +++ b/2015/.idea/misc.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" /> + <component name="CidrRootsConfiguration"> + <sourceRoots> + <file path="$PROJECT_DIR$/01" /> + <file path="$PROJECT_DIR$/02" /> + <file path="$PROJECT_DIR$/03" /> + <file path="$PROJECT_DIR$/utils" /> + </sourceRoots> + </component> +</project> \ No newline at end of file diff --git a/2015/.idea/runConfigurations/Day_01.xml b/2015/.idea/runConfigurations/Day_01.xml new file mode 100644 index 0000000..c657567 --- /dev/null +++ b/2015/.idea/runConfigurations/Day_01.xml @@ -0,0 +1,7 @@ +<component name="ProjectRunConfigurationManager"> + <configuration default="false" name="Day 01" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$PROJECT_DIR$/01" PASS_PARENT_ENVS_2="true" PROJECT_NAME="2015" TARGET_NAME="2015_01" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="2015" RUN_TARGET_NAME="2015_01"> + <method v="2"> + <option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" /> + </method> + </configuration> +</component> \ No newline at end of file diff --git a/2015/.idea/runConfigurations/Day_02.xml b/2015/.idea/runConfigurations/Day_02.xml new file mode 100644 index 0000000..7b50e47 --- /dev/null +++ b/2015/.idea/runConfigurations/Day_02.xml @@ -0,0 +1,7 @@ +<component name="ProjectRunConfigurationManager"> + <configuration default="false" name="Day 02" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$PROJECT_DIR$/02" PASS_PARENT_ENVS_2="true" PROJECT_NAME="2015" TARGET_NAME="2015_02" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="2015" RUN_TARGET_NAME="2015_02"> + <method v="2"> + <option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" /> + </method> + </configuration> +</component> \ No newline at end of file diff --git a/2015/.idea/runConfigurations/Day_03.xml b/2015/.idea/runConfigurations/Day_03.xml new file mode 100644 index 0000000..baccb08 --- /dev/null +++ b/2015/.idea/runConfigurations/Day_03.xml @@ -0,0 +1,7 @@ +<component name="ProjectRunConfigurationManager"> + <configuration default="false" name="Day 03" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$PROJECT_DIR$/03" PASS_PARENT_ENVS_2="true" PROJECT_NAME="2015" TARGET_NAME="2015_03" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="2015" RUN_TARGET_NAME="2015_03"> + <method v="2"> + <option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" /> + </method> + </configuration> +</component> \ No newline at end of file diff --git a/2015/01/CMakeLists.txt b/2015/01/CMakeLists.txt index 77fde18..82bc838 100644 --- a/2015/01/CMakeLists.txt +++ b/2015/01/CMakeLists.txt @@ -1,4 +1,4 @@ -set(PROJECT_NAME AOC_2015_01) +set(PROJECT_NAME 2015_01) project(${PROJECT_NAME} C ASM_NASM) diff --git a/2015/02/CMakeLists.txt b/2015/02/CMakeLists.txt index 6ce6bec..e14ddd9 100644 --- a/2015/02/CMakeLists.txt +++ b/2015/02/CMakeLists.txt @@ -1,4 +1,4 @@ -set(PROJECT_NAME AOC_2015_02) +set(PROJECT_NAME 2015_02) project(${PROJECT_NAME} C ASM_NASM) diff --git a/2015/03/CMakeLists.txt b/2015/03/CMakeLists.txt index cdcadd0..f237670 100644 --- a/2015/03/CMakeLists.txt +++ b/2015/03/CMakeLists.txt @@ -1,4 +1,4 @@ -set(PROJECT_NAME AOC_2015_03) +set(PROJECT_NAME 2015_03) project(${PROJECT_NAME} C ASM_NASM) diff --git a/2015/CMakeLists.txt b/2015/CMakeLists.txt index d6765cc..14d5d34 100644 --- a/2015/CMakeLists.txt +++ b/2015/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.20) -project(AOC) +project(2015) enable_language(ASM_NASM) diff --git a/2015/utils/benchmark.h b/2015/utils/benchmark.h index 8f92a01..1774677 100644 --- a/2015/utils/benchmark.h +++ b/2015/utils/benchmark.h @@ -1,5 +1,5 @@ -#ifndef ADVENTOFCODE_BENCHMARK_H -#define ADVENTOFCODE_BENCHMARK_H +#ifndef INC_2015_BENCHMARK_H +#define INC_2015_BENCHMARK_H #include "stdio.h" @@ -64,4 +64,4 @@ void runBenchmark(const entryPointCallback ep, char* input) { #undef BENCHMARK_RUNS -#endif //ADVENTOFCODE_BENCHMARK_H +#endif //INC_2015_BENCHMARK_H diff --git a/2015/utils/file.h b/2015/utils/file.h index 5ac48da..c7b94c0 100644 --- a/2015/utils/file.h +++ b/2015/utils/file.h @@ -1,5 +1,5 @@ -#ifndef ADVENTOFCODE_FILE_H -#define ADVENTOFCODE_FILE_H +#ifndef INC_2015_FILE_H +#define INC_2015_FILE_H #include "stdio.h" #include "stdlib.h" @@ -65,4 +65,4 @@ char* readFile(const char* filename) { return contents; } -#endif //ADVENTOFCODE_FILE_H +#endif //INC_2015_FILE_H diff --git a/README.md b/README.md index c5e87d1..87f96d5 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,9 @@ The source code is in `main.rs`. The run configuration executes the `main()` fun ## \[2015\] NASM x64 Assembly -The repository contains a CMake project (`2015/CMakeLists.txt`) in the respective year's folder, which sets up every day as a CMake subproject. You should be able to load the CMake project into [CLion](https://www.jetbrains.com/clion/), as long as you have a toolchain named `Visual Studio x64` set to use the `amd64` architecture. +The repository contains a CMake project (`2015/CMakeLists.txt`) in the respective year's folder, which sets up every day as a CMake subproject. + +You should be able to load the CMake project into [CLion](https://www.jetbrains.com/clion/), as long as you have a toolchain named `Visual Studio x64` set to use the `amd64` architecture. The source code is in `main.c`, which is either in the puzzle's own folder, or in `utils` if no adjustments are needed. By default, `main.c` reads the whole input file into a buffer, and passes it as a parameter to the `entryPoint` function defined in `main.asm` which implements the logic and output of each puzzle.