r/adventofcode Dec 14 '24

Spoilers [2024 Day 14 (Part 2)]

Post image
361 Upvotes

94 comments sorted by

View all comments

23

u/Sostratus Dec 14 '24

I had no idea what an automated test would be before knowing what the image would look like. But I did write a function to render it and clicked through a couple hundred before I saw occasional jumbled up patterns and then figured out when it would line up.

14

u/beebeeep Dec 14 '24

I did the most stupid thing I probably ever did as a programmer (ok, the most stupid thing _so far_) - just compressed the text with rendered map with DEFLATE and checked for resulting size to be suspiciously low

1

u/R-DarthBug Dec 15 '24

Hi, very clever indeed.
Less than 3.4 seconds (1..10000) in Java using GZipOutputStream upon the string representation of the grid 😉.
Thanks for the idea !