Worked out why the wolves weren't working...

This commit is contained in:
simon 2014-07-02 23:00:23 +01:00
parent 9ad67ba0a4
commit 19db0e0673

View file

@ -90,11 +90,11 @@
(>= (population cell :deer) 2) (>= (population cell :deer) 2)
(merge cell {:deer (int (* (:deer cell) 4))}))) (merge cell {:deer (int (* (:deer cell) 4))})))
;; wolves arrive occasionally at the edge of the map. ;; wolves arrive occasionally at the edge of the map.
;; (fn [cell world] (fn [cell world]
;; (cond (and (< (count (get-neighbours world cell)) 8) (cond (and (< (count (get-neighbours world cell)) 8)
;; (< (rand 50) 1) (< (rand 50) 1)
;; (= (population cell :wolves) 0)) (= (population cell :wolves) 0))
;; (merge cell {:wolves 2}))) (merge cell {:wolves 2})))
;; if there are not enough deer to sustain the population of wolves, ;; if there are not enough deer to sustain the population of wolves,
;; some wolves die or move on. ;; some wolves die or move on.
(fn [cell world] (fn [cell world]