Skip to content

rqbazan/advent-of-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

30 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Advent of Code

πŸŽ„ Feliz Navidad, Buon Natale, Merry Christmas

Description

This repository contains my solutions for the Advent of Code challenges.

Structure

The repository is structured as follows:

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

    ./src/<year>/day-<day>/part-<part>
    

    For instance: ./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:

    cd ./src/2023/day-01/part-1
  2. Run the main.cpp file, which is the solution:

    g++ -std=c++20 -o out ./main.cpp && ./out
  3. Check the output:

    cat out.txt

Check a solution

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

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:

make check 2023/day-01/part-1

About

πŸŽ„ Feliz Navidad, Buon Natale, Merry Christmas

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published