part1 fieldMap instrs = passwordOf endPerson
where field = mkFlatField fieldMap
startPos = V2 0 $ fromJust $ minimumOf (folded . filteredBy (_r . only 0) . _c) $ M.keysSet fieldMap
part1 fieldMap instrs = passwordOf endPerson
where field = mkFlatField fieldMap
startPos = V2 0 $ fromJust $ minimumOf (folded . filteredBy (_r . only 0) . _c) $ M.keysSet fieldMap
(Down, F) -> person & position . _r .~ 0 & position . _c .~ (interpol c 100 149)
(Left, F) -> person & position . _r .~ 0 & position . _c .~ (interpol r 50 99) & facing .~ Down
(Down, F) -> person & position . _r .~ 0 & position . _c .~ (interpol c 100 149)
(Left, F) -> person & position . _r .~ 0 & position . _c .~ (interpol r 50 99) & facing .~ Down
isCell r c rows = isRow && isCol && ((rows !! r) !! c) `elem` (".#" :: String)
where isRow = r < length rows
isCol = c < (length $ rows !! r)
isCell r c rows = isRow && isCol && ((rows !! r) !! c) `elem` (".#" :: String)
where isRow = r < length rows
isCol = c < (length $ rows !! r)