Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rqbazan/advent-of-code

🎄 Feliz Navidad, Buon Natale, Happy Merry Christmas
https://github.com/rqbazan/advent-of-code

advent-of-code programming-challenges

Last synced: about 2 months ago
JSON representation

🎄 Feliz Navidad, Buon Natale, Happy Merry Christmas

Awesome Lists containing this project

README

        

# Advent of Code

> 🎄 Feliz Navidad, Buon Natale, Merry Christmas

## Description

This repository contains my solutions for the [Advent of Code](https://adventofcode.com/) challenges.

## Structure

The repository is structured as follows:

- Each solution in well contained in a folder with the following structure:

```
./src//day-/part-
```

For instance: [./src/2023/day-01/part-1](./src/2023/day-01/part-1)

- Each solution folder contains the following files:

- `main.cpp`: The solution code.
- `in.txt`: The input data from the challenge.
- `out.txt`: The solution output.
- `submit.txt`: The submitted answer to Advent of Code website.

## Run a solution

### Using VSCode

1. Run current file

2. Debug current file

### Manually

1. Go to any solucion folder. For instance:

```bash
cd ./src/2023/day-01/part-1
```

2. Run the `main.cpp` file, which is the solution:

```bash
g++ -std=c++20 -o out ./main.cpp && ./out
```

3. Check the output:

```bash
cat out.txt
```

## Check a solution

There is a script that checks the solutions and compares the output with the submitted answer.

```bash
make check
```

Example Output

Checking ./src/2024/day-01/part-2/main.cpp
✅ Check passed

Checking ./src/2024/day-01/part-1/main.cpp
✅ Check passed

Checking ./src/2023/day-01/part-2/main.cpp
✅ Check passed

Checking ./src/2023/day-01/part-1/main.cpp
✅ Check passed

Checking ./src/2023/day-04/part-1/main.cpp
✅ Check passed

Checking ./src/2023/day-03/part-2/main.cpp
✅ Check passed

Checking ./src/2023/day-03/part-1/main.cpp
✅ Check passed

Checking ./src/2023/day-02/part-2/main.cpp
✅ Check passed

Checking ./src/2023/day-02/part-1/main.cpp
✅ Check passed

It will walk through all the solutions and check if the output is correct.

Optionally, you can pass a specific folder:

```bash
make check 2023/day-01/part-1
```