 ;; evolution.el -- the evolution demo, ported to EmacsLisp
 
+;; where to go from here:
+;; - terrain
+;; - different types of creature
+;; - more stats
+;; - faster drawing
+
+;; size of the field
 (defvar evolution-width 80)
 (defvar evolution-height 30)
+
+;; size of the jungle
 (defvar evolution-jungle-rectangle '(45 10 10 10))
 (defvar evolution-plant-energy 20)
 
+;; minimum energy required to reproduce
+(defvar evolution-reproduction-energy 200)
+
+;; customizable colors
+(defvar evolution-fence-color "yellow")
+
+;; hash holding coordinates of the plants
 (defvar evolution-plants (make-hash-table :test #'equal))
 
-;; Create an initial animal, centered, with random genes.
-;;
+;; Animals
 ;; The genes determine the likelihood of the animal going in a certain
 ;; direction
+(defstruct animal x y energy dir genes)
+
+;; Create an initial animal, centered, with random genes.
 (defvar evolution-animals
   (list (make-animal :x      (ash evolution-width -1)
                      :y      (ash evolution-height -1)

(defun add-plants ()
  (apply 'random-plant evolution-jungle-rectangle)
  (random-plant 0 0 evolution-width evolution-height))

(defstruct animal x y energy dir genes)

(defun move (animal)
  (let ((dir (animal-dir animal))

                           below x
                           do (update-world)
                           (draw-world))
                   (evolution-function))))))))

