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]
|
||||
[op (case op
|
||||
"/" #(int (Math/round (float (/ %1 %2))))
|
||||
"/" #(int (Math/round (double (/ %1 %2))))
|
||||
"#" not=
|
||||
(-> op read-string eval))])))
|
||||
|
||||
|
@ -50,12 +50,12 @@
|
||||
|
||||
(def robot-field-write-mixin
|
||||
; 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]
|
||||
(assoc-in
|
||||
world
|
||||
(path-to-robot-field robot-idx field-name)
|
||||
(float (* data multiplier)))))
|
||||
(double (* data multiplier)))))
|
||||
|
||||
(defrecord StorageRegister [robot-idx reg-name val])
|
||||
(extend StorageRegister
|
||||
|
Loading…
Reference in New Issue
Block a user