diff --git a/src/robotwar/brain.clj b/src/robotwar/brain.clj index 4fabb05..9b79a8a 100644 --- a/src/robotwar/brain.clj +++ b/src/robotwar/brain.clj @@ -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))]))) diff --git a/src/robotwar/register.clj b/src/robotwar/register.clj index 50eb894..5ed95e8 100644 --- a/src/robotwar/register.clj +++ b/src/robotwar/register.clj @@ -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