r/adventofcode • • Dec 03 '25

Visualization [2025 Day 03] CLI Visualization

Post image

I visualized my greedy solution for Advent of Code Day 3. The animation shows a sliding window selecting the next maximum digit while ensuring enough characters remain to reach the required output length. Blue = current window, Red = remaining-picks region, Green = chosen max.The number builds step-by-step from left to right.

This works for both parts of the problem

Edit:

Another example with longer input: https://imgur.com/a/MLghbhk (i couldn't add another gif here)

139 Upvotes

38 comments sorted by

View all comments

Show parent comment

2

u/crrime Dec 04 '25

Ever since I was a little boy I yearned for the ANSI escape codes