Function aoc::year2019::day17::compress

source ยท
fn compress<'a>(path: &'a str, movement: &mut Movement<'a>) -> ControlFlow<()>
Expand description

Find three patterns that can be repeated in any order to build the whole path.

Uses a greedy backtracking algorithm that attempts to match as much of the remaining string as possible with known patterns, before trying combinations of a new pattern (up to the maximum movement function length of 20 characters).