# kuldeep9071/advent-of-code-2024 architecture

> Architecture diagram of the GitHub repository kuldeep9071/advent-of-code-2024, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kuldeep9071/advent-of-code-2024
- Repository: https://github.com/kuldeep9071/advent-of-code-2024

## Overview

##### Project type and purpose
- This is a collection of standalone C++ solutions for the Advent of Code 2024 daily puzzles.
- Each “DayX” folder holds two parts of a puzzle (Problem1.cpp and Problem2.cpp), its input data, and the corresponding output.
- There is no central server, front-end, or long-running service—each solution is a self-contained command-line program.

##### File structure
- Top-level directories: Day1, Day2, …, Day25 plus README.md.
- Inside each DayN folder:
- Problem1.cpp and Problem2.cpp (source code)
- input.txt (puzzle input)
- output.txt (captured output)
- Build instructions exist only in the README—no build scripts or CI configs in the repo.

##### Key insights from README
- Solutions are built with g++ (C++17) and run with a timeout.
- No external libraries beyond the C++ standard library.
- Usage is purely command-line based.

##### Main components
a. Source code modules (Problem1.cpp, Problem2.cpp for each day)
b. Input data files (input.txt)
c. Build system (g++ compiler + timeout wrapper)
d. Executable artifacts (DayN_Part1, DayN_Part2)
e. Output files (output.txt)

##### Relationships and interactions
- The developer invokes the compiler (g++) on a .cpp file and input.txt.
- The compiler produces an executable.
- The executable consumes input.txt at runtime (via stdin).
- The executable writes results to stdout or redirects into output.txt.

##### Repeatability
- That Days 1–25 follow the same pipeline.

##### Essential architectural elements
- No external services or databases—everything is local files and command-line tools.
- Compile→run→output cycle.
- Technological details (C++17, g++, timeout) near the “Build Environment” block.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "AdventOfCode2024"
        direction TB
        README["README.md"]:::doc
        subgraph "Day1"
            direction TB
            P1["Problem1.cpp"]:::source
            P2["Problem2.cpp"]:::source
            Input["input.txt"]:::data
            Build["g++ -std=c++17 + timeout"]:::tool
            Exec1["Executable Part1"]:::exec
            Exec2["Executable Part2"]:::exec
            Output["output.txt"]:::data

            P1 -->|"compile"|Build
            P2 -->|"compile"|Build
            Build -->Exec1
            Build -->Exec2
            Input -->|"stdin"|Exec1
            Input -->|"stdin"|Exec2
            Exec1 -->|"stdout redirect"|Output
            Exec2 -->|"stdout redirect"|Output
        end
        subgraph "Days 2–25 (×24)"
            direction TB
        end
    end

    click P1 "https://github.com/kuldeep9071/advent-of-code-2024/blob/main/Day1/Problem1.cpp"
    click P2 "https://github.com/kuldeep9071/advent-of-code-2024/blob/main/Day1/Problem2.cpp"
    click Input "https://github.com/kuldeep9071/advent-of-code-2024/blob/main/Day1/input.txt"
    click Output "https://github.com/kuldeep9071/advent-of-code-2024/blob/main/Day1/output.txt"
    click README "https://github.com/kuldeep9071/advent-of-code-2024/blob/main/README.md"

    classDef source fill:#ADD8E6,stroke:#000,color:#000;
    classDef data fill:#90EE90,stroke:#000,color:#000;
    classDef tool fill:#FFA500,stroke:#000,color:#000;
    classDef exec fill:#D3D3D3,stroke:#000,color:#000;
    classDef doc fill:#FFFFE0,stroke:#000,color:#000;
```
