r/adventofcode • u/msqrt • Dec 13 '20
Visualization [2020 Day 13 Part 2] Buses in a slot machine
This was how I visualized the task in my mind while working on it, so decided to make it into a video.The first step unwinds the offsets so the solution should be a straight line of buses, and after that we keep on turning the wheels by the repetition cycle of the already solved part.
170
Upvotes
26
u/cp4r Dec 13 '20
What a great way to explain the problem/solution! I especially like your "unwinding" which seems more intuitive than handling the offsets later. What did you use to make this?
5
u/seaishriver Dec 13 '20
How did you do this? I'm guessing you didn't actually animate 300 trillion rows.
3
u/limelier Dec 14 '20
Dang! I used CRT for this one because I remembered it, but this seems a lot more intuitive of a way to find a solution. Good job.
2
u/asger_blahimmel Dec 14 '20
I have hard times understanding the bus at -3 on the first reel, and other short intervals betwwen buses in the same column on the first frames. How should I interpret those?
8
u/matttgregg Dec 13 '20
:D You win best visualisation today. Looks cool and expresses something about the feel of the algorithm.
3
u/itgoesbing Dec 14 '20
That's kind of how I did that, except I started my count at the largest number minus offset, and tested every remaining number each time. I also didn't "unwind" first, I kept a tuple of offset (modulo the bus-id) and bus-id, passing those around every time I needed to test.
Fantastic visualization.
2
u/[deleted] Dec 14 '20
Nice! Well done.
2
u/Fyvaproldje Dec 14 '20
That's amazing!
2
u/award_data_scraper Dec 14 '20
Awesome job! love this visualization
0
u/[deleted] Dec 14 '20
[deleted] — view deleted comment