aoc::year2016

Module day10

Source
Expand description

ยงBalance Bots

Performs a topological sort of the bots, starting from raw values, passing through some number of bots then ending in an output.

We maintain a VecDeque of chips and destinations starting with raw inputs. Once each robot receives 2 chips then its low and high outputs are added to the queue.

As a minor optimization we only need to store the product of outputs 0, 1 and 2.

Structsยง

  • Bot ๐Ÿ”’

Functionsยง

Type Aliasesยง