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

Main

Description

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

Search for the cheapest way to rearrange lizards in a maze to get all the lizards back into the correct rooms.

Synopsis

Documentation

data Cell Source #

Constructors

Open 
Amphi 

Fields

toCell :: Char -> Maybe Cell Source #

Compute all the information needed from a character in the input map.

isRoom :: Coord -> Bool Source #

Predicate for rooms (rather than hallways)

main :: IO () Source #

step :: Map Coord Cell -> [AStep (Map Coord Cell)] Source #

Step the simulation once tracking the cost of the move.

roomClean :: Map Coord Cell -> Int -> Bool Source #

Check that all the amphis in a room are supposed to be there.

done :: Map Coord Cell -> Bool Source #

Check that everything on the map is where it should be.