All examples By author By category About

1wheel

advent-of-code-05

Day 5 of Advent of Code, Part Two

The puzzle loads an array of numbers and jumps through them, using the current position's value as the next index. It stops when it jumps out of the array. After a visit, numbers less then three are incremented and numbers greater than or equal to three are decremented.

Here the, each element in the array is shown as horizontal line. Darker values show lower numbers. The x position shows progression of the algorithm. After a position is repeatedly visited, it's value gets closer and closer to three until it isn't drawn anymore.

The purple lines show the rate of visits each position gets over time; each column represents about 30,000 jumps.