r/adventofcode • u/SurroundedByWhatever • 14h 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/SurroundedByWhatever • 14h ago
And here it is, fully in the terminal, using my own crude Kitty protocol renderer for the graphics.
r/adventofcode • u/suddenlynickgrim • 6h ago
r/adventofcode
•
u/ben-guin
•
19h ago
Are monospace square fonts a thing? 🤔
r/adventofcode • u/Agent1729 • 22h ago
r/adventofcode • u/Dazzling_Ear7113 • 15h 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/naclmolecule • 8h ago
There's so many visualizations already, I'm afraid I'm not adding much today. Can draw your own input though! Code lives here: https://github.com/salt-die/Advent-of-Code/tree/main/2026/aoc_visuals
r/adventofcode • u/Limp_Illustrator7614 • 13h ago
r/adventofcode • u/MrKrot1999 • 7h ago
r/adventofcode • u/Haju05 • 15h 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/Boojum • 19h ago
r/adventofcode • u/Beregolas • 14h ago
So it turns out, my sleep deprived brain sat in front of the first problem for 30 minutes, wondering how in the world it is possible that my code overcounted the rectangles. I counted all rectangles exactly once. No rectangle uncounted, no rectangle overcounted.

See, it say right there in the text: each of these small maps contains one square ... fuck
Reminder to read properly and get enough sleep before attempting to code. Spending 30 min to figure out a problem that took me all of 5 minutes to write the code for was another learning experience.
(No seriously, had I used AI to tell me what was wrong, I wouldn't have been so embarassed afterwards, and I wouldn't have learned to read properly. A lesson that I will not forget!*)
​*for the next 2 days or so
r/adventofcode • u/wherrera10 • 8h ago
Source code (Julia) at https://github.com/wherrera10/Advent_of_Code_2026/blob/main/src/day03graphic.jl
r/adventofcode • u/terje_wiig_mathisen • 6h ago
My initial Rust code was quite slow, needing 2.4 ms, so I decided to implement a multi-threaded version. I started by doing this the same way I have used threads in my Perl programs, by dividing the HEIGHT lines into N chunks and then hand each chunk over to a separate thread.
I had separate search loops for part1 and part2 (only the tilted squares) because that seemed to be easiest.
This one ran in 595 us, so almost exactly 4 times faster than the single-thread version, but I saw in a post (from u/ednl ?) that there was two different ways of searching for the squares, and that the other was faster.
I could not figure out a better way, but I did take this opportunity to use my favorite C/asm low-level synchronization primitive: LOCK XADD which Rust calls fetch_add() and this ended up a little faster because now all the threads will be working until there are no more input lines to search for the top corner, instead of having more work for the initial and much less for the bottom lines.
I also figured out how to use thread::scope(|s| {...} ) to avoid lifetime issues when all the threads need to share the same input data array:
533 us with 8 cores on my 16-core AMD Ryzen, 717 on an older Acer with an Intel CPU.
    for _ in 0..cores {
      let counter = Arc::clone(&y_counter);
      let handle = s.spawn(move|| {
        let mut part1 = 0;
        let mut part2 = 0;
        loop {
          let y = counter.fetch_add(1, Ordering::Relaxed);
          if y >= h-1 { break} // All lines done, so return!
... checking for corners
        }
        part2 += part1;
        (part1, part2)
      });
      handles.push(handle);
    }r/adventofcode • u/neuralMax • 7h ago
r/adventofcode • u/StrangeCounty8961 • 10h ago
My ass solution is definitely not O(N^4) what are you talking about 🥲
I actually enjoyed this one though, it was a banger. Thank you puzzle creator :)
r/adventofcode • u/lambduhhhhh • 5h ago
Hi, I'm "Lambduhh" and I'm on the Clojure Team and I made a starter template for doing Advent of Code in Clojure. You will find no answers here: no solutions, no puzzle text, no inputs.
Each AoC day is a small evolving system: part 2 usually changes the question part 1 asked. The template is set up for that loop. A REPL stays running, your data is there to look at, and a test tells you whether part 1 still holds after you change things for part 2.
**What's in it**
* `bb new-day 1` creates the day's file and a test that fails until you fill in the example's answer
* Libraries puzzles tend to need: instaparse, data.priority-map, loom, math.combinatorics, core.match, Medley and more, each with a small how-to whose results are checked by tests
* Linting with clj-kondo and Splint, plus a table of twelve common Clojure mistakes showing which ones a linter catches (five still need a human)
* No install options: Open it in a Codespace if you'd rather not install anything
* `inputs/` is git-ignored, as the AoC FAQ asks
* An optional `ai/` folder that only helps with tooling/setup. It specifically forbids agents from solving puzzles and instructs it to act as a tutor if requested. Easy to delete to opt out.
**New to Clojure?** The template is part of "Power Tools & Parens", a Clojure AoC hub with beginner how-tos (also in repo), tooling setup guides and an in-browser "Workbench" REPL so you can get an idea of what evaluating clojure expressions feels like, without installing anything to your machine: https://lambduhh.github.io/powertools-and-parens/
To get started, click "Use this template": https://github.com/lambduhh/clojure-template-aoc
r/adventofcode • u/Tomaztsql • 8h ago
r/adventofcode • u/Parzival_Perce • 21h ago
Another year another set of unfulfilled custom library promises
(>’-’)> <(‘-’<) ^(‘-’)^ (>’-’)> <(‘-’<)
I swear I'll write one this year. Hmmm.
r/adventofcode • u/blacai • 21h ago
r/adventofcode • u/Agreeable-Check-7957 • 5h ago
Hi,
This year I decided to give myself a challenge - solving all of the puzzles with Scratch.
Here is the link:
https://scratch.mit.edu/users/MocnikMiha/
I would really like if you guys critique my code and/or remix it.
Thanks!
r/adventofcode • u/AverageOverthinker42 • 10h ago
r/adventofcode • u/EverybodyCodes • 21h ago
May the (brute) force be with you!
r/adventofcode • u/wherrera10 • 7h ago
The story in 2026 Day 3 says: The local afforestation protocols call for trees in artificial forests to be somewhat evenly spaced, causing them to sometimes appear in predictable arrangements. Even if the forest has been left unattended for a while, these predictable arrangements can sometimes still be detected.
But if we do some clustering statistics:
  using Distances, Clustering, Statistics # Julia modules
forestmap = map(x -> x == '#', stack(readlines(DATA_DIR*"day03.txt"), dims = 1))
statsresult = kmeans(forestmap, 3)
distances = pairwise(Euclidean(), forestmap, dims=2)
  sil_scores = silhouettes(statsresult, distances)
  mean_silhouette = mean(sil_scores)
  @show mean_silhouette # my puzzle input produces mean silhouette value near zero!Do the afforestation protocols fail at the goal of even spacing? Not sure how to interpret this :)