Advent of Code
This visualization demonstrates the redistribution of memory blocks in the "Advent of Code" Day 6 challenge, tracking how many redistribution cycles occur before a state repeats. The code uses XQuery 3.1 with recursive functions `local:zero-out-highest` and `local:add-blocks` to reallocate blocks from the highest-value bank across the array, while `local:calculate-state` records each state as a hyphen-separated string and stops when a duplicate state appears. The data source is a hardcoded sequence of 16 integers representing the initial memory banks, and the output is the integer count of iterations performed until repetition, rendered as plain text. No external visualization libraries are used; the example focuses purely on algorithmic state computation.
AI-generated description