Skip to content

This is my attempt for Advent of Code using C++. I will probably shift back to Python at some point, stop me before I do that :)

Notifications You must be signed in to change notification settings

PrasannaMaddila/advent-of-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

advent-of-code

This is my attempt for Advent of Code using C++. I will probably shift back to Python at some point, stop me before I do that :)

Build System

The current build system is ingenious. We build the solution for Day <day_number> ( and optionally the year <yr_number> ) using the following command.

make build DAY=<day_number> ( YEAR=<yr_number> )

This places the solution executable in build/, and the relevant call to make run DAY=<day_number> will execute the file. make run will print the answers out. Similarly,

make bench DAY=<day_number> ( YEAR=<yr_number> )

will benchmark the code. This will not print out the answers out.

Solution Structure

Each solution is actually implemented as a header ! Furthermore, on the completed implementation of each file, we tag it with a #define as follows:

#define PART_1
int part1() {
    ...
}

Then, depending on the mode ( run vs bench ), we link these headers to different main files, found in utils/. Each of these main files checks for these constants, and executes the part that they detect.

About

This is my attempt for Advent of Code using C++. I will probably shift back to Python at some point, stop me before I do that :)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published