From 1dd77f9657ba2a2aecc7edf5c9d95c1a15e0b2e6 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Mon, 23 Jan 2023 22:37:56 +0000 Subject: [PATCH] remove unneeded destructuring --- rover.fnl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rover.fnl b/rover.fnl index f1a7d4d..6fbdb8f 100644 --- a/rover.fnl +++ b/rover.fnl @@ -10,7 +10,7 @@ (any obstacles (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 (if (. {:w true :e true} direction) (/ distance (math.cos (/ (* math.pi y) 180))) @@ -21,8 +21,8 @@ :w {:x (wrap-longitude (- x distance))} :e {:x (wrap-longitude (+ x distance))}))) -(fn drive [{: x : y : direction : stopped &as r} distance] - (if stopped +(fn drive [r distance] + (if r.stopped r (let [next-move (merge r (try-to-drive r distance))] (if (at-obstacle? next-move)