Advent of Code 2023 ๐ solutions by @Aquaj
README is based on Jรฉrรฉmie Bonal's AoC Ruby template.
Advent of Code is an online event created by Eric Wastl. Each year, starting on Dec 1st, an advent calendar of small programming puzzles are unlocked once a day at midnight (EST/UTC-5). Developers of all skill sets are encouraged to solve them in any programming language they choose!
Something is wrong with global snow production, and you've been selected to take a look. The Elves have even given you a map; on it, they've used stars to mark the top fifty locations that are likely to be having problems.
You've been doing this long enough to know that to restore snow operations, you need to check all fifty stars by December 25th.
These were not written as example of clean or efficient code but are simply my attempts at finding the answers to each day's puzzle as quickly as possible. Performance logging was added simply as a fun way to compare implementations with other competitors.
Day | Part One | Part Two | Solutions | |
---|---|---|---|---|
โ | Day 1: Trebuchet?! | ๐ | ๐ | Solution |
โ | Day 2: Cube Conundrum | ๐ | ๐ | Solution |
โ | Day 3: Gear Ratios | ๐ | ๐ | Solution |
โ | Day 4: Scratchcards | ๐ | ๐ | Solution |
โ | Day 5: If You Give A Seed A Fertilizer | ๐ | ๐ | Solution |
โ | Day 6: Wait for it | ๐ | ๐ | Solution |
Day 7: TBD | Solution | |||
Day 8: TBD | Solution | |||
Day 9: TBD | Solution | |||
Day 10: TBD | Solution | |||
Day 11: TBD | Solution | |||
Day 12: TBD | Solution | |||
Day 13: TBD | Solution | |||
Day 14: TBD | Solution | |||
Day 15: TBD | Solution | |||
Day 16: TBD | Solution | |||
Day 17: TBD | Solution | |||
Day 18: TBD | Solution | |||
Day 19: TBD | Solution | |||
Day 20: TBD | Solution | |||
Day 21: TBD | Solution | |||
Day 22: TBD | Solution | |||
Day 23: TBD | Solution | |||
Day 24: TBD | Solution | |||
Day 25: TBD | Solution |
Run bundle install
to install any dependencies.
Each day computes and displays the answers to both of the day questions and their computing time in ms. To run it type ruby day<number>.rb
.
If the session cookie value is provided through the SESSION env variable (dotenv is available to provide it) โ it will
fetch the input from the website and store it as a file under the inputs/
folder on its first run.
Lack of a SESSION value will cause the code to raise an exception unless the input file (inputs/{number}
) already
present. The code will also raise if the input isn't available from AoC's website (404
error).