mirror of
https://github.com/richardharrington/robotwar.git
synced 2024-10-31 20:09:53 +00:00
changed all float coercion to double coercion
This commit is contained in:
parent
8b9b11d803
commit
0945151aab
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
(def op-map (into {} (for [op assembler/op-commands]
|
(def op-map (into {} (for [op assembler/op-commands]
|
||||||
[op (case op
|
[op (case op
|
||||||
"/" #(int (Math/round (float (/ %1 %2))))
|
"/" #(int (Math/round (double (/ %1 %2))))
|
||||||
"#" not=
|
"#" not=
|
||||||
(-> op read-string eval))])))
|
(-> op read-string eval))])))
|
||||||
|
|
||||||
|
@ -50,12 +50,12 @@
|
|||||||
|
|
||||||
(def robot-field-write-mixin
|
(def robot-field-write-mixin
|
||||||
; returns a world with the value of a field in the robot hash map altered
|
; returns a world with the value of a field in the robot hash map altered
|
||||||
; (with the number being cast to floating point before being pushed)
|
; (with the number being cast to double before being pushed)
|
||||||
(fn [{:keys [robot-idx field-name multiplier]} world data]
|
(fn [{:keys [robot-idx field-name multiplier]} world data]
|
||||||
(assoc-in
|
(assoc-in
|
||||||
world
|
world
|
||||||
(path-to-robot-field robot-idx field-name)
|
(path-to-robot-field robot-idx field-name)
|
||||||
(float (* data multiplier)))))
|
(double (* data multiplier)))))
|
||||||
|
|
||||||
(defrecord StorageRegister [robot-idx reg-name val])
|
(defrecord StorageRegister [robot-idx reg-name val])
|
||||||
(extend StorageRegister
|
(extend StorageRegister
|
||||||
|
Loading…
Reference in New Issue
Block a user