Function aoc::year2021::day19::parse

source ยท
pub fn parse(input: &str) -> Vec<Located>
Expand description

Convert the raw input into a vec of unknown scanners, then do all the heavy lifting of figuring out the relative orientations and translations of each scanner.

First choose an arbitrary scanner that determines the reference orientation and that we decide is located at the origin.

Then for each remaining unknown scanner, check if the signature indicates a potential match. If confirmed, we determine the orientation and translation then add the scanner to a todo list to recheck against other unknown scanners.

This works for situations such as A -> B -> C, where A and B overlap, B and C overlap, but not A and C.