 (ns coders-strike-back.core
   (:gen-class))
+
+(def checkpoint-core-size 100)
 
 (defn inc-atom [curr-val] (inc curr-val))
 (defn dec-atom [curr-val] (dec curr-val))

(defn convert-degree-to-radian [degree]
  (* degree (/ Math/PI 180)))

;;Compute boost value between 0 and 100
(defn compute-boost [next-checkpoint-distance next-checkpoint-angle]
  (cond
    (> (Math/abs next-checkpoint-angle) 90) "0"
    (< (Math/abs next-checkpoint-angle) 30) "100"
    (and (< next-checkpoint-distance 1000) (> (Math/abs next-checkpoint-angle) 30)) "0"
    (and (< next-checkpoint-distance 1000) (< (Math/abs next-checkpoint-angle) 30)) "50"
    (> next-checkpoint-distance 4000) "100"
    true (str (Integer/valueOf (Math/round (* 100 (Math/abs (Math/cos (convert-degree-to-radian next-checkpoint-angle)))))))))

(defn compute-x [next-checkpoint-x] next-checkpoint-x)

(defn compute-y [next-checkpoint-y] next-checkpoint-y)

(def boost-used? (atom false))
(def game-loop-counter (atom 0))

                   nextCheckpointX (read) nextCheckpointY (read)
                   nextCheckpointDist (read) nextCheckpointAngle (read)
                   opponentX (read) opponentY (read)
                   opponent-distance (distance x y opponentX opponentY)]
                  ; nextCheckpointX: x position of the next check point
                  ; nextCheckpointY: y position of the next check point
                  ; nextCheckpointDist: distance to the next checkpoint
