How martyjre/advent_of_code_2023 works
Project type and purpose
• This is a small CLI‐based Kotlin project for solving the daily Advent of Code puzzles.
• Each “DayXX.kt” is one independent puzzle solution, using a shared template and utilities.
File structure
• Top level:
• build.gradle.kts / gradle/… / gradlew(.bat) – Gradle build and wrapper files
• settings.gradle.kts – project settings
• README.md / .gitignore
• Days/ – raw input files and test inputs for each day
• src/ – Kotlin source files
• Inside src/:
• Day01.kt – Day10.kt – one file per day’s solution
• DayTemplate.kt – skeleton for new days
• Utils.kt – shared helper functions (parsing, IO, common algorithms)
README
• Confirms this is an Advent of Code template in Kotlin.
• No web UI or network layer – purely computes puzzle answers from local input files.
Main components
a. CLI Runner (Gradle “run” task)
b. Day Modules (Day01 through Day10 classes)
c. Template Module (DayTemplate.kt – blueprint for new day modules)
d. Utilities Module (Utils.kt – parsing, common routines)
e. Input Data Store (Days/ folder: Day10.txt, tests)
f. Build System (Gradle)
Relationships and interactions
• The CLI Runner is invoked via Gradle or main() entrypoint.
• Runner discovers or is told which DayXX class to execute.
• A DayXX class:
• Reads raw puzzle input from Days/DayXX.txt (via Utils.IO functions)
• Processes the data using puzzle‐specific logic
• May call shared utility methods in Utils.kt
• Emits results to the console or test harness
• The Template module shows the developer where to plug in new Day modules.
• The Build System compiles all .kt files, resolves dependencies, and packages artifacts.
Architectural patterns and design principles
• Modular per‐day plugin pattern: each day is an independent module/class.
• Single responsibility: Utils.kt for shared code, one file per puzzle.
• Convention over configuration: file names match day numbers, template guides structure.