On the page, you can also convert the raster image into an SVG.
#svg
On the page, you can also convert the raster image into an SVG.
#svg
Inspired by a @standupmaths.bsky.social video from a month ago and the generator made by @christianp.mathstodon.xyz.ap.brid.gy, I decided to make my own webpage for generating messages with a chosen number of black pixels.
interactive.strigido.com/self-countin...
I solved the second part by using flood fill + binary search.
The solution is found in 15 ms.
#AdventOfCode Day 18 Part 2
I solved today's #AdventOfCode problem with flood fill, visualized below.
#AdventOfCode Day 14 Part 2 was interesting - "find the tree".
I did it by tracking the number of robots that were adjacent to other robots. This number spiked when they formed a Christmas tree.
Exactly what I was thinking.
And here's it running on an actual input:
#AdventOfCode
Visualization of an algorithm for solving the first part of #AdventOfCode day 12:
#AdventOfCode Day 10 - 2nd part visualized:
#AdventOfCode Day 10 - 1st part visualized:
and part 2:
Here's a visualization of day 9 part 1:
(1 pixel = 1 block) #AdventOfCode
Most of these are done with Python using ImageDraw from the Pillow library.
Currently, I'm not publishing the source code. Honestly, it's nothing pretty to look at (It just needs to work). But I might publish all the source code on my GitHub later, when I'm done and make the final compilation video.
#AdventOfCode 2024 | Day 8 | visualization of the second part:
#AdventOfCode 2024 - Day 8: Resonant Collinearity
Visualization of the first part:
It looks like this year's ASCII art on the calendar page is going to be a big 10 for the ten years of Advent of Code!
Something for today: a visualization of the algorithm I used for finding equations that could possibly be true:
#AdventOfCode
Nothing new from the problems themselves, but I have acquired new skills in doing visualizations in Python and Blender - super fun to see algorithms come to life!
Part 1 of Day 6 #AdventOfCode
Maybe it's the way you're detecting loops? I used a set to store 3-value tuples (x, y, orientation). Every time the guard moves, you add to the set. If a tuple is already in the set, that means the guard has already been on that exact location facing the same way and is therefore stuck in a loop.
Even with that optimization, your solution would still take minutes to complete, so something big could probably be done more efficiently. My Python code took 12 seconds to complete.
First of all, I only checked the coordinates the guard actually visits. Placing a new obstacle that isn't in the guard's way does nothing. That already eliminates around 70% of the possibilities.
Wow! This is cool!
I was in a Blender mood today. Here's a little animation of today's example. #AdventOfCode
A visualization of an algorithm running on the example for day 5 #AdventOfCode
Very cool!
I don't think I did anything particularly advanced today. Just a couple of dictionaries and sets.
I'm not really concerned (yet) about there potentially being a 90% faster algorithm. I'm going to save some of my mental energy for later, when the execution time is longer than a mouse click.
Yeah, I used a 3ร3 sliding window approach for part 2, but I didn't make an animation.
Screenshot showing the Advent of Code calendar. The first five days all have two stars. 15 h 27 min 38 s is the time remaining until the puzzle on day 6 becomes public.
I just completed "Print Queue" - Day 5 - Advent of Code 2024 #AdventOfCode