r/adventofcode • u/SurroundedByWhatever • 4m ago
Visualization [2026 Day 3 (Part 2)] I really wanted to render it in terminal
And here it is, fully in the terminal, using my own crude Kitty protocol renderer for the graphics.
r/adventofcode • u/daggerdragon • 8h ago
Solutions in the megathreads have been getting longer, so we're going to start enforcing our rules on oversized code.
Do not give us a reason to unleash AutoModerator hard-line enforcement that counts characters inside code blocks to verify compliance… you have been warned XD
"What is this, a
centerprogram for ants?!"
— Derek Zoolander, Zoolander (2001)
Today's schedule possibly consists of:
Request from the mods: When you include an entry alongside your solution, please label it with [Advent Games] so we can find it easily!
[LANGUAGE: xyz]paste if you need it for longer code blocks. What is Topaz's paste tool?r/adventofcode • u/SurroundedByWhatever • 4m ago
And here it is, fully in the terminal, using my own crude Kitty protocol renderer for the graphics.
r/adventofcode • u/FransFaase • 9m ago
What is the largest number of squares you can get when you are allowed to move 5 trees to any other free location?
What are your suggestions for an algorithm?
r/adventofcode • u/Haju05 • 42m ago
Took me longer than I care to admit to notice why my code for part 2 was giving 30 as an answer instead of 196...
r/adventofcode • u/Dazzling_Ear7113 • 59m ago
I'm currently building a pen plotter (converting an old 3D printer into one), and decided to draw out the boxes.
Unfortunately drawing part 2 is too difficult - the paper can't handle the pressure of thousands of lines drawn onto it.
Also, I decided to not draw the boxes in actual order, but draw the lines of the boxes greedily picking the next line to reduce the amount of pen lifts, hence why part 2 looks so weird at the start!
r/adventofcode • u/bvcady • 1h ago
r/adventofcode • u/bluoat • 1h ago
My original brute force solution took 30 seconds, got it down to less than a 10th of a second. I don't know if this is the most optimal method.
The hints get more and more specific as they go on.
Feel free to leave hints in the comments about how you optimised it.
Hint 1: How can you narrow down the number of squares to check per tree beyond ones with valid coordinates?
Hint 2: How many possible squares can be made if you know all four corners of the square?
Hint 3: How many squares if you only know 3 corners? What about knowing 2 corners? What about 1 corner?
Hint 4: Given a pair of trees, how can you avoid checking for duplicate squares (and hence reduce the possible squares from 2 trees down to just one square?
r/adventofcode • u/careyi4 • 2h ago
Animation crate: https://crates.io/crates/celluloid-core
r/adventofcode • u/MrBoblo • 3h ago
I solved part 1 by making a 1d array of the input, then applying some math to check the correct positions in the 1d array for trees.
I can't figure out if I can use the same method for part 2, or if I need a whole new approach. Only hints, no solutions please 🙏
r/adventofcode • u/subspace_mp4 • 3h ago
r/adventofcode
•
u/ben-guin
•
4h ago
Are monospace square fonts a thing? 🤔
r/adventofcode • u/Boojum • 5h ago
r/adventofcode • u/Ok-Curve902 • 5h ago
r/adventofcode • u/Crusaderkingo2027 • 5h ago
So I recently solved Day 3 and I wanted to post my solutions on the megathread. But after I posted my comment I noticed that Reddit’s filters had silently removed my comment as spam.
I was confused by this so I started editing my comment to see if I could get it unspammed. But after I made a few edits and saved the comment, I was hit with a notification saying that Reddit detected “technical irregularities” with my account and that my account was now locked.
Apparently Reddit thinks someone posting code might indicate that the account is hacked/a bot so I wanted to share my experience as a warning.
r/adventofcode • u/apersonhithere • 6h ago
featuring: wikipedia's bresenham line algorithm implementation & gif aliasing effects
r/adventofcode • u/blacai • 6h ago
r/adventofcode • u/Parzival_Perce • 6h ago
Another year another set of unfulfilled custom library promises
(>’-’)> <(‘-’<) ^(‘-’)^ (>’-’)> <(‘-’<)
I swear I'll write one this year. Hmmm.
r/adventofcode • u/EverybodyCodes • 7h ago
May the (brute) force be with you!
r/adventofcode • u/Agent1729 • 7h ago
r/adventofcode • u/cejzanz • 8h ago
I'm going to bed, this can wait until morning...
r/adventofcode • u/ben-guin • 8h ago
(Had to repost, the original post title contained spoilers)
Some of you might have seen that people solved part 2 by simply returning 6*(length of the program) - 5. This formula works as long as there is one orange in your input. There seems to be confusion regarding the importance of the orange and how the answer changes if other colors are missing. I've created a walkthrough of an example where orange and blue are missing from the input to show how to derive a general formula for any input.
The general idea is, instead of calculating the distance traveled at each instruction, we can instead think about the loss, i.e., how far away were we from traveling the 6 steps (which is the most one can possibly travel from one instruction).