this post was submitted on 06 Dec 2025
24 points (96.2% liked)

Advent Of Code

1199 readers
3 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
 

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

you are viewing a single comment's thread
view the rest of the comments
[–] strlcpy@lemmy.sdf.org 3 points 2 weeks ago (3 children)

Well it uses the input of course but I found that if you make it truly random, the lines mostly go down in a straight line, all bunching up in the middle, which isn't very pleasing. So now the beams have a "current direction" which has a 25% of flipping at every splitter

[–] CameronDev@programming.dev 1 points 2 weeks ago (2 children)

I used a u8, one bit per level to do mine, but because not all bits correspond to a splitter, it ends up duplicating a lot of the paths. Which is why I made the lowest bit at the top, so it flip-flops a lot, giving the appearance of multiple different paths :D

[–] strlcpy@lemmy.sdf.org 2 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

If I understand correctly, your visualization shows up to to 256 unique paths then?

In this one, every time the beam passes a splitter, the other side is put on a queue, so eventually all possible paths are traced, breadth first. Initially I worked through the options recursively, but that depth-first filling out was boring to look at.

[–] CameronDev@programming.dev 1 points 2 weeks ago

Yeah, max of 256 paths, and if there were no holes in the splitter layout, it would be the full 256. Also why i had to limit the depth to 16 layers, more than that and the brute forcing gets a bit silly.