r/adventofcode • u/MrAntex • Dec 06 '22
Visualization [2022 Day 5 #1] Small terminal Python animation for part 1 of Day 5, never tried "drawing" on terminal before but quite proud of the result ! (didn't put the whole thing because it's a bit long and we get the idea)
1.1k
Upvotes
40
u/itsjjpowell Dec 06 '22
This is really cool! What library did you use to build this? I'd love to peek at the code to see how I could do something like this!
7
u/whenrow Dec 06 '22
Did you model the Crane 9001 too ? :D
2
u/RokKuz3 Dec 06 '22
This is SO cool! Can you please share the code or the GitHub link? Thanks!
2
u/keithstellyes Dec 06 '22
I love this! makes me want to go back and do this for previous days
2
u/j-hillman Jan 01 '23
This is truly excellent and very much appreciated. Thank you for sharing your code. I've learned a lot by reviewing both this visualization and some of your other solutions. Cheers and God bless.
57
u/[deleted] Dec 06 '22
This is great - you don't even need to struggle to parse the input, just wrap a crane around it!
5
u/Overlorddamygod Dec 06 '22
!remindme 2 days
5
u/hiimbob000 Dec 06 '22
Coolest visualisation I've seen of a problem
4
u/nottings Dec 06 '22
So good!
1
u/Alkyonios Dec 06 '22
Anybody else had the problem of a tower not having enough blocks to perform an instruction?
For example, my program gets to the instruction "move 9 from 6 to 7" but tower 6 only has one block left (this is the 23rd instruction). The text didn't say anything about how to handle that situation so I just assume it's not supposed to happen.
I tried to just move to the next instruction whenever this happens, but then I'm left with two empty towers at the end.
I have tried printing the towers after every instruction and everything looks alright.
I've also made sure that the initial state is parsed correctly, and that I copied the input correctly.
3
u/zamotic Dec 06 '22
Sadly it probably took you just as long to write this animation as it did for me to write my solution to the problem.
It took me way longer than it should have to read in the stacks of crates into a usable manner.
2
u/[deleted] Dec 06 '22
In love with this, nice job!
2
u/fractalfox11 Dec 06 '22
What a beautiful solution!
2
u/WsDoragon Dec 06 '22
!remindme 2 days
2
u/imjustreallystupid Dec 06 '22
That... looks super cool
2
u/navneetmuffin Dec 06 '22
This is just awesome
2
u/hugthemachines Dec 06 '22
That is just beautiful.
2
u/dmrazor Dec 06 '22
Beautiful!
2
u/Ok_Car_9272 Dec 06 '22
Wow! I was thinking about trying this with JS but would probably take me many days lol.
Awesome
2
u/gerbosan Dec 06 '22
Something crossed my mind right now... Tower of hanoi
2
u/[deleted] Dec 06 '22
This gets my vote for my favourite visualization
2
u/StckOverflw Dec 06 '22
That is genuinely so cool
2
u/Jomy10 Dec 07 '22
It’s so satisfying to watch
1
u/[deleted] Dec 06 '22
!remindme 2 days
1
u/RunningFromSatan Dec 07 '22
This looks like something they could use for the terminals on Season 2 of Severance.
-3
u/mebeim Dec 06 '22
Awesome visualization! Small note: cranes do not usually extend their arm like that, they have a hoist moving through it instead. You could try making the arm fixed at the maximum length and only mov the wire, see how that looks.
0
u/[deleted] Dec 06 '22
[deleted] — view deleted comment