https://github.com/abd-01/aoc2024
Advent of Code 2024
https://github.com/abd-01/aoc2024
advent-of-code cpp cpp11
Last synced: about 1 year ago
JSON representation
Advent of Code 2024
- Host: GitHub
- URL: https://github.com/abd-01/aoc2024
- Owner: ABD-01
- License: mit
- Created: 2025-01-11T11:43:00.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-14T14:13:21.000Z (over 1 year ago)
- Last Synced: 2025-02-14T15:26:30.899Z (over 1 year ago)
- Topics: advent-of-code, cpp, cpp11
- Language: C++
- Homepage: https://abd-01.github.io/AoC2024/
- Size: 37.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Advent of Code 2024 - C++ Solutions
## 🚀 Overview
This repository contains my solutions for Advent of Code 2024, implemented in C++. As someone with experience in C and Python, I am using AoC as a hands-on way to improve my C++ skills while solving fun and challenging problems.
📖 **Blogs:**
- [Days 1 to 8](https://abd-01.github.io/posts/2025-01-04-Advent-of-Code-2024-Day-1-to-8/)
## 🔧 Setup & Compilation
### Input Files
Before running the solutions, you need to download the input files for each day. There are two ways to organize them:
#### 1. Per-Day Directory Structure
Place each input file in its corresponding day's folder as shown below. The CMake script will automatically copy them to the build/ directory when you build the project.
```
|-- Day01_Historian_Hysteria
| `-- input.txt
|-- Day02_Red-Nosed_Reports
| `-- input.txt
|-- Day03_Mull_It_Over
| `-- input.txt
| .
| .
| .
|-- DayN_XXX_XXX
| `-- input.txt
```
A warning will be shown if now corresponding input file is found.
#### 2. Single `build/` Directory
Alternatively, you can place all input files directly inside the `build/` directory with the naming format:
```
build/input1.txt
build/input2.txt
build/input3.txt
.
.
.
build/inputN.txt
```
### Build and Run Instructions
#### 1. Clone the Repository
```bash
git clone https://github.com/ABD-01/AoC2024.git
cd AoC2024
```
#### 2. Create a `build/` Directory
```bash
mkdir build
cd build
```
#### 3. Configure the Project with CMake
```bash
cmake ..
```
#### 4. Build the Executables
```bash
make
```
#### 5. Run the Solutions
- **Run all solutions**
```bash
make run
```
- **Run a specific day's solution** (e.g., Day 2)
```bash
make run2
```
Each day's executable will automatically read the input file (input{day}.txt) from the build/ directory, where CMake has placed it during the build process.
## 📌 Contributions
If you'd like to contribute, feel free to suggest improvements, alternative solutions or criticism via issues or pull requests.
## 📜 License
This project is open-source and available under the [MIT License](./LICENSE).