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

Main

Description

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

>>> :{
:main +
  "#.######\n\
  \#>>.<^<#\n\
  \#.<..<<#\n\
  \#>v.><>#\n\
  \#<^v^^>#\n\
  \######.#\n"
:}
18
54
Synopsis

Documentation

data SearchState Source #

Constructors

S 

Fields

main :: IO () Source #

>>> :main
295
851

shortest Source #

Arguments

:: UArray Coord Char

input map

-> Int

initial time step

-> Coord

starting location

-> Coord

ending location

-> Int

minimum travel time

Find the shortest time from source to destination starting at a particular time step.

step Source #

Arguments

:: UArray Coord Char

input map

-> SearchState 
-> SearchState 

Given a set of locations the elf could be find the set the elf can be at next.

isOpen Source #

Arguments

:: UArray Coord Char

input map

-> Int

time step

-> Coord

location

-> Bool

location available

Check if a location in the world is available