mirror of
https://github.com/richardharrington/robotwar.git
synced 2024-07-07 12:28:55 +00:00
fixed bug in robot.clj, all previous tests now working
This commit is contained in:
parent
f1b94518f7
commit
b43eb26b37
@ -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,7 +164,7 @@
|
||||
(assoc-in
|
||||
new-world
|
||||
[:robots robot-idx]
|
||||
(into robot {:pos-x pos-x
|
||||
(into new-robot {:pos-x pos-x
|
||||
:pos-y pos-y
|
||||
:v-x v-x
|
||||
:v-y v-y})))))
|
||||
|
Loading…
Reference in New Issue
Block a user