X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=advent15%2Fsrc%2Fadvent15optics.hs;h=777588e4967391252e3c4cf41049bbf66f297b97;hb=0ec58176ef0b59be76d4c2798d4d3fabdb121a24;hp=d9a2f8cd07bec1e5d5292ec6ff6460facdbc4a70;hpb=b904f5370b9389023824baeeece358ae7bfef278;p=advent-of-code-19.git 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