Here are my solutions for the 2022 edition of the Advent of Code.
I will try to write a solution for every exercice in C++. When the problem is not too difficult,
I will also try to golf it in Ruby.
I will also solve some of the exercices in Rust and Prolog if I get the time.
There is a batch (so windows-only for now) script to automatically run a solution if it is implemented.
To use it, you first need to put your input in a file called dayX.txt (X is the number of the day) in a folder called input. Then type
.\run.bat <lang> <day> <part>In the command line at the root of the project.
lang is one of c++, cpp, ruby, prolog, and rust, day is a number between 1 and 25 and part is either 1 or 2.
- To compile and run the
c++solutions, you need to haveg++installed and in thePATH. - To compile and run the
Rustsolutions, you need to haveRustinstalled andrustcin the path. - To run the
prologsolutions, you need to haveswipl(from SWI-Prolog) installed and in thePATH. - To run the
Rubysolutions, you need to haverubyinstalled and on the path.
| Day | C++ | Ruby | Prolog | Rust | Golf pt.1 | Golf pt.2 |
|---|---|---|---|---|---|---|
| 1 | ✅✅ | ✅✅ | ✅✅ | ✅✅ | 43B | 50B |
| 2 | ✅✅ | ✅✅ | ✅✅ | ✅✅ | 48B | 53B |
| 3 | ✅✅ | ✅✅ | ❌❌ | ❌❌ | 69B | 72B |
| 4 | ✅✅ | ✅✅ | ❌❌ | ❌❌ | 89B | 91B |
| 5 | ✅✅ | ✅✅ | ❌❌ | ❌❌ | 188B | 180B |
| 6 | ✅✅ | ✅✅ | ❌❌ | ❌❌ | 49B | 51B |
| 7 | ✅✅ | ✅✅ | ❌❌ | ❌❌ | 231B | N/A |
| 8 | ✅✅ | ❌❌ | ❌❌ | ❌❌ | N/A | N/A |
| 9 | ✅✅ | ❌❌ | ❌❌ | ❌❌ | N/A | N/A |
| 10 | ✅✅ | ✅✅ | ❌❌ | ❌❌ | 56B | 115B |
| 11 | ❌❌ | ❌❌ | ❌❌ | ❌❌ | N/A | N/A |
| 12 | ❌❌ | ❌❌ | ❌❌ | ❌❌ | N/A | N/A |
| 13 | ❌❌ | ❌❌ | ❌❌ | ❌❌ | N/A | N/A |
| 14 | ❌❌ | ❌❌ | ❌❌ | ❌❌ | N/A | N/A |
| 15 | ❌❌ | ❌❌ | ❌❌ | ❌❌ | N/A | N/A |
| 16 | ❌❌ | ❌❌ | ❌❌ | ❌❌ | N/A | N/A |
| 17 | ❌❌ | ❌❌ | ❌❌ | ❌❌ | N/A | N/A |
| 18 | ❌❌ | ❌❌ | ❌❌ | ❌❌ | N/A | N/A |
| 19 | ❌❌ | ❌❌ | ❌❌ | ❌❌ | N/A | N/A |
| 20 | ❌❌ | ❌❌ | ❌❌ | ❌❌ | N/A | N/A |
| 21 | ❌❌ | ❌❌ | ❌❌ | ❌❌ | N/A | N/A |
| 22 | ❌❌ | ❌❌ | ❌❌ | ❌❌ | N/A | N/A |
| 23 | ❌❌ | ❌❌ | ❌❌ | ❌❌ | N/A | N/A |
| 24 | ❌❌ | ❌❌ | ❌❌ | ❌❌ | N/A | N/A |
| 25 | ❌❌ | ❌❌ | ❌❌ | ❌❌ | N/A | N/A |