The aim of this project is to strengthen my skills by solving problems proposed by the Advent Of Code for different years. It is an excellent opportunity to improve my skills in algorithms, reading text files and regular expressions (REGEX). Each solution is designed to be efficient and well-structured, with readability and performance in mind.
For each year, I've decided to choose a different language in order to revise languages I know (Python, Java), or to improve my skills in languages I'm less familiar with (JavaScript).
The Advent Of Code problems are published daily in December, and cover a variety of challenges ranging from string manipulation to more complex algorithms.
The project is structured into several directories, each corresponding to a year (and therefore a language) of the Advent Of Code. Within each directory, the challenges are organised by day, with a dedicated file for each problem.
AdventOfCode/
│
├── Solution_2015/
│ ├── textfiles
│ │ ├── 01.txt
│ │ ├── ...txt
│ │ ├── 25.txt
│ ├── Year2015_Solution.py
│ ├── ReadFile.py
│ ├── main.py
│
├── Solution_2016/
│ ├── textfiles
│ │ ├── 01.txt
│ │ ├── ...txt
│ │ ├── 25.txt
│ ├── Year2016_Solution.java
│ ├── ReadFile.java
│ ├── Main.java
│
├── Solution_2017/
│ ├── textfiles
│ │ ├── 01.txt
│ │ ├── ...txt
│ │ ├── 25.txt
│ ├── Year2017_Solution.ts
│ ├── ReadFile.ts
│ ├── main.ts
│
├── .../
│
├── Solution_2023/
│ ├── textfiles
│ │ ├── 01.txt
│ │ ├── ...txt
│ │ ├── 25.txt
│
└── main.sh
To run this project, you must have:
- For year 2015: Python 3.12.6 installed on your machine. You can check the version of Python by running the following command:
python --version- For year 2016: Java 21.0.4 installed on your machine. You can check the version of Java by running the following command:
java --version- For year 2017: Node 20.18.0 installed on your machine. You can check the version of Node by running the following command:
node --version- Clone this repository on your local machine using the following command:
git clone https://github.com/Erwan-Br/AdventofCode.git- Open the repository:
cd AdventofCode- Launch the file main.sh:
On Windows:
sh main.sh -y <yearNumber>On Linux:
./main.sh -y <yearNumber>- Customize the output displayed (optionnal): Fo each year, In main.xx, you can choose to display the answer you want. For the year 2015, you might want to display only a few responses so you would have to change main.py to:
if "__main__" == __name__:
print(Year2015_Solution.getSolution(<dayNumber>, True)) # True for Part One, False for Part TwoThe file main.sh will do everything for you, just launch it with the correct arguments!
These tickets contain the list of solutions to be implemented for each year, and for each ticket an associated branch is created, allowing the work on each year to be dissociated:
All the problems retrieve input from text files, so it is possible to find your answer by using my code and changing the contents of the text files.
I encourage you to try and understand the algorithms involved, and if you have any questions please don't hesitate to ask, I'll be happy to answer them.
Contributions are welcome! If you would like to suggest improvements or correct errors, don't hesitate to submit a pull request or open an issue.
- Erwan BROUDIN - Principal author
This project is licensed under the MIT license - see the LICENSE file for more details.