r/adventofcode • u/ImpossibleSav • Dec 18 '23
Visualization [2023 Day 16] [Python] Updated visualization of the Basilisk — one line of code to solve them all!
70
Upvotes
r/adventofcode • u/ImpossibleSav • Dec 18 '23
11
u/ImpossibleSav Dec 18 '23
For Day 16's Allez Cuisine challenge, I updated my visualization of the Basilisk — my nickname for my line of Python code that solves all of the Advent of Code problems (up to day 16) all at once! Each colour represents the proportion of characters in the Basilisk that are needed to solve each part of each day. I wrote a small program to automatically count the characters and create the rainbow line too!
I'm no competitive programmer, so my solutions aren't optimal and it takes about 45 seconds to run the full thing on my computer. Plus I'm getting pretty busy so I'm not sure if I'll be able to continue to add many more days. But I'm proud of how far I've gotten and the monster I created! :)
Feel free to follow along on my GitHub — I may still try and get all the days in, even if I need to complete some in January. I made it through a dozen days last year too, creating the Beast!
Thanks for all the fun y'all! :)
18
u/[deleted] Dec 18 '23
This is undoubtedly one of the most impressive things I have seen so far this Advent of Code. Bloody good job, OP!
7
u/morgoth1145 Dec 19 '23
You're back! I was sad when the one liners stopped last year, glad to see the monster return.
3
u/echols021 Dec 19 '23
This is epic.
Looking at your code (the one line of it) gives me the impression you could probably write a program to convert the text of a normal program into a one-liner...
2
u/Dezarro74 Dec 19 '23
I genuinely love your passion for coding. The way you respond to others is how our community should be. Thank you for your work, it inspires all of us. I just wish I would see answers for the last 9 days :(
2
u/SoftwareSource Dec 19 '23
Damn, you need that new G9 57" screen for this one
Damn impressive, congrats!
2
u/goedel-gang Dec 19 '23
This is absolutely amazing - I love it! (Also your graphic is fantastic.) Back when I was a delinquent teenager I used to enjoy this sort of thing too :), but I've never done anything anywhere near this ambitious. Back in my day we didn't have the walrus operator yet so we had to make do with lots of nested
lambdas and one-element lists to store mutable state.You've inspired me to give it another go for old times' sake - here I've done days 14 and 16 from this year in one line each (without using the walrus operator - I wanted to see if I still had it in me!) I managed to produce a disgusting 665-byte solution and a 776-byte solution for the two respective days. It ain't much but it's honest work.