Advent Of Code

1197 readers
14 users here now

An unofficial home for the advent of code community on programming.dev! Other challenges are also welcome!

Advent of Code is an annual 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.

Everybody Codes is another collection of programming puzzles with seasonal events.

EC 2025

AoC 2025

Solution Threads

M T W T F S S
1 2 3 4 5 6 7
8 9 10 11 12

Visualisations Megathread

Rules/Guidelines

Relevant Communities

Relevant Links

Credits

Icon base by Lorc under CC BY 3.0 with modifications to add a gradient

console.log('Hello World')

founded 2 years ago
MODERATORS
1
 
 

Everyone loves a good visualisation, share any visualisations that you have created here.

2
 
 

Advent of Code is an annual Advent calendar of small programming puzzles that can be solved in any programming language you like.

Puzzles have a backstory and then a collection of different inputs with people getting a random input and needing to submit the corresponding output for the puzzle and their input to successfully complete it.

Puzzles start easy and get harder as the days go on. Every day has two different puzzles in increase in difficulty with you getting access to the second puzzle after solving the first.

Puzzles are released every day at midnight ET and can be completed anytime after they are released (but people who solve them quicker after they're been released get more points for the site leaderboard).

https://adventofcode.com/


What can I post here?

Anything relating to the event! Whether that be a meme, asking for help, sharing solutions, etc.

Every day a megathread will be posted that solutions to that day should go into. In the megathread you can post code using code blocks or by linking to repositories or pastebins.

To make a code block make three backticks, make a new line and put the code on lines, then put a newline and do three backticks on that

e.g.

```
console.log('Hello World')
```

becomes

console.log('Hello World')  

If you want a spot to post code externally (e.g. if it is too large or you want to have a spot to store it) we have a forgejo instance and an opengist instance

you can find them at https://git.programming.dev/ and https://blocks.programming.dev/


How should I format my post titles?

Try to keep titles in this general format:

[help, etc. category if applicable] [YEAR Day # (Part X)] [programming language if applicable] Post Title

For example:

[2023 Day #5 (Part 3)] [Rust] My attempt at a solution

Another example:

[Help] [2023 Day #2] What does this sentence mean

This helps people avoid spoilers and lets people use it as an archive by searching if they find out about the event in the middle and are starting from the beginning

3
49
submitted 2 years ago* (last edited 2 years ago) by Ategon@programming.dev to c/advent_of_code@programming.dev
 
 

Hey everyone! I set up a private leaderboard for the programming.dev community so we can have one for the community in addition to the global one

The leaderboard code is 3316962-6587d422

Looking forward to seeing you guys there! Ill make a post at the end with the top people on the leaderboard and the version on the site will auto update as people complete challenges


Full instructions on Joining the Leaderboard

  • Log in on https://adventofcode.com/ using one of the methods such as through GitHub
  • Go to the leaderboard section in the navbar
  • Click the private leaderboard button on the page
  • Enter 3316962-6587d422 into the text box for entering a leaderboard join code
  • Click join

Update: Ive made a new leaderboard so that I could rename it to something that isnt just my username, the code there is updated to the new one that should be joined

4
 
 

Part 2 is basically running just the isolation rule from Conway's game of life until the world state stabilizes. I'm curious if anyone noticed this and used an existing cellular automata program or library to handle the computation.

5
 
 

Day 12: Christmas Tree Farm

Megathread guidelines

  • Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
  • You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL

FAQ

6
7
 
 

Day 11: Reactor

Megathread guidelines

  • Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
  • You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL

FAQ

8
 
 

Day 10: Factory

Megathread guidelines

  • Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
  • You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL

FAQ

9
 
 

It is only going to be downhill from here

10
 
 

Day 9: Movie Theater

Megathread guidelines

  • Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
  • You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL

FAQ

11
12
 
 

Day 8: Playground

Megathread guidelines

  • Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
  • You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL

FAQ

13
 
 

Okay, so I'm almost a decade behind on this...

But I only found out about AoC this year. So I'm gradually going through the backlog. And this is the first one that has left me clueless about a reasonable approach.

https://adventofcode.com/2015/day/19

I'm on part 2 of this problem (reconstructing the molecule in the least number of steps). So far, I've figured...

  • I need to work "backwards" (going from the target molecule down to e in the fewest steps possible) in order to bound the problem
  • Tried brute forcing it this way, way too inefficient
  • So I tried limiting the maximum number of steps--even at 10 steps max, I only make it through a small fraction in several minutes
  • I tried rewriting my recursive function as a while loop, didn't help

Things I could try:

  • use more efficient data types (I'm using Python and doing slicing, not sure if changing that would make a difference)
  • represent the formulae in some other format (not sure what would be better)
  • doing something less "brute-force-y", not sure what that would be

Anyone willing to offer any pointers?

14
15
 
 

I think you fellow solvers will find this talk interesting. There's a few minutes of the usual who am I and what is AoC but there's some good stuff about growing pains, the puzzle design process and why he likes to throw in a hard puzzle in an early day.

edit: bah, I see it was already posted - the Lemmy search doesn't seem to find it unless you limit the search to URL...

16
 
 

Day 7: Laboratories

Megathread guidelines

  • Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
  • You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL

FAQ

17
 
 

Day 6: Trash Compactor

Megathread guidelines

  • Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
  • You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL

FAQ

18
 
 
19
20
 
 

Day 5: Cafeteria

Megathread guidelines

  • Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
  • You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL

FAQ

21
 
 

Day 4: Printing Department

Megathread guidelines

  • Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
  • You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL

FAQ

22
 
 

Day 3: Lobby

Megathread guidelines

  • Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
  • You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL

FAQ

23
 
 

Day 2: Gift Shop

Megathread guidelines

  • Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
  • You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL

FAQ

24
 
 

Day 1: Secret Entrance

Megathread guidelines

  • Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
  • You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL

FAQ

25
 
 

Quest 20: Dream in Triangles

  • Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
  • You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL

Link to participate: https://everybody.codes/

And it's a wrap! Thanks to everyone who participated or lurked :)

view more: next โ€บ