From b43eb26b376571384d6c1a24a90fa80dcc450537 Mon Sep 17 00:00:00 2001 From: Richard Harrington Date: Tue, 6 Aug 2013 19:21:35 -0400 Subject: [PATCH] fixed bug in robot.clj, all previous tests now working --- src/robotwar/robot.clj | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/robotwar/robot.clj b/src/robotwar/robot.clj index d01e0fa..08ef887 100644 --- a/src/robotwar/robot.clj +++ b/src/robotwar/robot.clj @@ -150,10 +150,10 @@ (if (>= (:damage robot) 100) world (let [new-world (brain/step-brain robot world) - new-robot (get-in world [new-world :robots robot-idx]) - desired-v-x (do (pprint new-robot) (brain/read-register + new-robot (get-in new-world [:robots robot-idx]) + desired-v-x (brain/read-register (get-in new-robot [:registers "SPEEDX"]) - new-world)) + new-world) desired-v-y (brain/read-register (get-in new-robot [:registers "SPEEDY"]) new-world) @@ -164,8 +164,8 @@ (assoc-in new-world [:robots robot-idx] - (into robot {:pos-x pos-x - :pos-y pos-y - :v-x v-x - :v-y v-y}))))) + (into new-robot {:pos-x pos-x + :pos-y pos-y + :v-x v-x + :v-y v-y})))))