remove unneeded destructuring
This commit is contained in:
parent
2dfc7ac5e4
commit
1dd77f9657
@ -10,7 +10,7 @@
|
|||||||
(any obstacles
|
(any obstacles
|
||||||
(fn [[ox oy]] (and (= ox x) (= oy y)))))
|
(fn [[ox oy]] (and (= ox x) (= oy y)))))
|
||||||
|
|
||||||
(fn try-to-drive [{: x : y : direction : stopped &as r} distance]
|
(fn try-to-drive [{: x : y : direction : stopped} distance]
|
||||||
(let [distance
|
(let [distance
|
||||||
(if (. {:w true :e true} direction)
|
(if (. {:w true :e true} direction)
|
||||||
(/ distance (math.cos (/ (* math.pi y) 180)))
|
(/ distance (math.cos (/ (* math.pi y) 180)))
|
||||||
@ -21,8 +21,8 @@
|
|||||||
:w {:x (wrap-longitude (- x distance))}
|
:w {:x (wrap-longitude (- x distance))}
|
||||||
:e {:x (wrap-longitude (+ x distance))})))
|
:e {:x (wrap-longitude (+ x distance))})))
|
||||||
|
|
||||||
(fn drive [{: x : y : direction : stopped &as r} distance]
|
(fn drive [r distance]
|
||||||
(if stopped
|
(if r.stopped
|
||||||
r
|
r
|
||||||
(let [next-move (merge r (try-to-drive r distance))]
|
(let [next-move (merge r (try-to-drive r distance))]
|
||||||
(if (at-obstacle? next-move)
|
(if (at-obstacle? next-move)
|
||||||
|
Loading…
Reference in New Issue
Block a user