commit 689fb894ada8f3f05dd5299e27bd6096ae6fe7ba
parent dc9088ffa50882ed4974ff0fb9fbc2875cc7b1f1
Author: Daniel Barlow <dan@telent.net>
Date: Mon, 23 Jan 2023 22:22:12 +0000
report position of the obstacle when stopped
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rover.fnl b/rover.fnl
@@ -57,7 +57,7 @@
:l (turn-left rover)
_ (assert false (. "unrecognised command " string))))]
(if (at-obstacle? next-move)
- (merge rover {:stopped true})
+ (merge rover {:stopped [next-move.x next-move.y]})
next-move)))
(fn fudge-for-pole [{: y &as r}]
@@ -193,7 +193,7 @@
(expect "It does not move past obstacles"
(let [obstacles [[5 5] [7 5]]]
(execute (rover 5 3 :n obstacles) [:f :f :f :f :f :f]))
- {:x 5 :y 4 :direction :n :stopped true})
+ {:x 5 :y 4 :direction :n :stopped [5 5]})
;; "TODO: deal with the south pole special casing"