Skip to content
/ aoc Public

🎄 My solutions and walkthroughs for Advent of Code and more related stuff.

License

Notifications You must be signed in to change notification settings

mebeim/aoc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code

Personal repository of Advent of Code solutions.

Quick links

About Advent of Code

Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. One programming puzzle a day is released from 1st to 25th December, divided in two parts (the second of which is unlocked after solving the first). Advent of Code is created by Eric Wastl, and is 100% free. If you like Advent Of Code and want to support its creator, you can donate to him here. If you want to hang out with other fellow coders, discuss about puzzles and solutions, or just have a look around, you can join the official subreddit: r/adventofcode, or the unofficial IRC channel: #adventofcode on irc.libera.chat, where you can also find me at the right time of the year.

About this repository

I discovered Advent of Code in 2017, and played my first edition in 2018. In this repository you can find my solutions and walkthroughs for the puzzles as well as other miscellaneus stuff like visualizations and other scripts.

In each year's directory you will find:

  • README.md: an in depth walkthrough of my (clean) solutions for the puzzle, day by day, with references to used algorithms and data structures and sometimes also comments/reflections.

  • solutions/: clean solutions for the puzzles. I usually rewrite, polish and optimize my original solutions whenever I have time after my first solve, along with a detailed walkthrough.

  • original_solutions/: my almost unedited original solutions for the puzzles, written as fast as I could while trying to solve puzzles for the first time. These solutions may use helpers I defined in my own utils module, as well as other external modules to make things easier. Do not expect the code in here to be sane/readable/fast[1].

  • lib/: small library of utilities written for this specific year. There are recurring concepts and problems each year. If needed, this directory will hold common code used by multiple solutions.

  • misc/: anything else interesting. This includes image/video visualizations of puzzles, additional interesting scripts, alternative solutions, and so on.

    • full_leaderboard.md: a complete leaderboard of all participants of Advent of Code for the year, including those who did not make it to the top 100, built by scraping each day's leaderboard.
    • calendar.gif: a GIF of the animated complete calendar for the year. That is, if I managed to finish all puzzles.

[1] I chose to upload "original" versions of solutions for two reasons: they are a good and fun way to see how I code, and they can be uploaded as soon as the leaderboard for the day is complete, as I often don't have time to rewrite them more cleanly right away.

How to run my solutions

You can provide your input from standard input:

2022/solutions/day01.py
# Paste input here and type CTRL+D when done...

You can save your input to file and pass its path as argument:

2022/solutions/day01.py path/to/your/input.txt

Or you can directly download your input from the AoC website. You will need to extract your session cookie from your browser and replace VALUE below with the real value, please only do this if you understand what you are doing.

curl -s --cookie 'session=VALUE' 'https://adventofcode.com/2022/day/1/input' | 2022/solutions/day01.py

Contributing

If you have question or spotted a typo/bug/mistake, you are most welcome to submit a new issue. For pull reqeusts and other kinds of contributions, please read CONTRIBUTING.md.

Licensing

The content of this repository, with the exception of walkthroughs (as defined in and linked at the top of this document), is licensed under the Apache License 2.0 license, which you can find in the file LICENSE.Apache-2.0. Walkthroughs are licensed under the Creative Commons BY-NC-SA 4.0 license, which you can find in the file LICENSE.CC-BY-NC-SA-4.0.


Copyright © 2018-2024 Marco Bonelli.