sln_2022_18
Copyright(c) Eric Mertens 2022
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Main

Description

https://adventofcode.com/2022/day/18

>>> :{
:main +
    "2,2,2\n\
    \1,2,2\n\
    \3,2,2\n\
    \2,1,2\n\
    \2,3,2\n\
    \2,2,1\n\
    \2,2,3\n\
    \2,2,4\n\
    \2,2,6\n\
    \1,2,5\n\
    \3,2,5\n\
    \2,1,5\n\
    \2,3,5\n"
:}
64
58
Synopsis

Documentation

main :: IO () Source #

>>> :main
4332
2524

findAir :: Set Coord3 -> Set Coord3 Source #

Given the the location of the lava cubes, find a bounding box of air surrounding them.

neigh :: Coord3 -> [Coord3] Source #

Neighbors of the cubes (excluding diagonals)

toC3 :: (Int, Int, Int) -> Coord3 Source #

Convert tuple to Coord3