X-Git-Url: https://git.njae.me.uk/?p=advent-of-code-19.git;a=blobdiff_plain;f=advent15%2Fsrc%2Fadvent15optics.hs;fp=advent15%2Fsrc%2Fadvent15optics.hs;h=777588e4967391252e3c4cf41049bbf66f297b97;hp=d9a2f8cd07bec1e5d5292ec6ff6460facdbc4a70;hb=88a664f402ff1f84004b3ae5d7b93ac9c52a65b7;hpb=2e08baf2e4c65958b9d62322eb50f919a788221f diff --git a/advent15/src/advent15optics.hs b/advent15/src/advent15optics.hs index d9a2f8c..777588e 100644 --- a/advent15/src/advent15optics.hs +++ b/advent15/src/advent15optics.hs @@ -114,9 +114,10 @@ searchHullDirection here (hull, boundary) direction where there = step here direction -- robot = _droid $ hull!here -- robot = fromJust $ preview (at here . _Just . isGoal) hull - robot = fromJust $ hull ^? at here . _Just . droid + -- robot = fromJust $ hull ^? at here . _Just . droid + robot = fromJust $ hull ^? ix here . droid -- distance = _fromStart $ hull!here - distance = fromJust $ hull ^? at here . _Just . fromStart + distance = fromJust $ hull ^? ix here . fromStart (robot', found) = runDroid robot direction -- newCell = Vacant { _droid = robot' -- , _fromStart = distance + 1