Day19
Copyright(c) Eric Mertens 2021
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Main

Description

https://adventofcode.com/2021/day/19

To correlate all the scanner readings this program selects the first scanner to be "correct". All other scanners will be oriented relative to the first scanner. As each scanner's location is fixed it will be queued to be compared to all the uncorrelated scanner outputs. Scanning in this order ensures no pair of scanners is compared more than once.

Synopsis

Documentation

main :: IO () Source #

>>> :main
457
13243

start Source #

Arguments

:: [[Coord3]]

uncorrelated scanner readings

-> [(Coord3, Set Coord3)]

correlated scanner locations and readings

Starts the scanner reading correlation algorithm.

assemble Source #

Arguments

:: [[Coord3]]

uncorrelated scanner readings

-> [(Coord3, Set Coord3)]

recently correlated scanners

-> [(Coord3, Set Coord3)]

completed correlated locations and readings

Worker for start.

prefilter :: [Coord3] -> [Coord3] Source #

Only bother checking offsets that occur enough times that it's possible to have an overlap

rotations :: Coord3 -> [Coord3] Source #

Return the 4 rotations of a point around the x-axis