Function aoc::year2021::day18::split

source ยท
fn split(tree: &mut [i32; 63]) -> bool
Expand description

Split a node into two child nodes.

Search the tree in an in-order traversal, splitting the first node over 10 found (if any). We can optimize the rules by immediately exploding if this results in a node 4 levels deep, as we know that the prior optimzation in the add function means that this is the only explosion possible.