 (defn evolve [individuals]
   "Takes a bunch of individuals (DNAs) and cross-breeds by fitness."
   (def the-map (rand-map))
-  (def ordered (reverse (sort-by (fn[dna] (simulate dna the-map)) individuals)))
-  (println (simulate (first ordered) the-map))
-  (def crossed (map (fn [pair]
-         (let [[a b] (vec pair)] (cross a b)))
-       (partition 2 ordered)))
-  (concat crossed (map mutate crossed)))
+  (def ordered (sort-by (fn[dna] (simulate dna the-map)) individuals))
+  (println (simulate (last ordered) the-map))
+  (def crossed 
+    (map (fn [pair] (let [[a b] (vec pair)] (cross a b)))
+         (partition 2 ordered)))
+  (concat (mutate crossed) ()))
 
 (defn -main
   "I don't do a whole lot ... yet."

(defn rand-dna []
  "Initializes a vector of random DNA."
  (defn rand-gene []
    (nth actions (rand-int (count actions))))
  (vec (repeatedly (** (count tiles) (count actions)) rand-gene)))

(defn cross [a b]
  "Crosses two vectors of DNA."



(def map-size 20) ; Size of the map used for robot simulation.
(def gold-prob 20) ; Probability in 100 that a tile contains gold.
(def simul-steps 100) ; Steps to allow the robot to make in a simulation.
(def tiles [\w \p \g]) ; Tiles that populate the map: wall, path, and gold.
(def actions [\u \d \l \r \x \p]) ; Actions the robot can take: up, down, left, right, pick up.
(def dir-vects ['(0 -1) '(0 1) '(-1 0) '(1 0) '(0 0)]) ; Direction vectors, corresponding to the actions.

(def mutation-prob 10) ; Probability in 100 that a gene will mutate.
(def action-penalty 5) ; How many points robot loses when hitting the wall or picking up when it shouldn't.
(def gold-value 10) ; How many points picking up gold is worth.

