projects
/
advent-of-code-19.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Done part 1
[advent-of-code-19.git]
/
advent15
/
src
/
advent15optics.hs
diff --git
a/advent15/src/advent15optics.hs
b/advent15/src/advent15optics.hs
index d9a2f8cd07bec1e5d5292ec6ff6460facdbc4a70..777588e4967391252e3c4cf41049bbf66f297b97 100644
(file)
--- 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
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 = _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
(robot', found) = runDroid robot direction
-- newCell = Vacant { _droid = robot'
-- , _fromStart = distance + 1