Small changes necessitated by reference from mw-ui.
This commit is contained in:
parent
37fad409ba
commit
9ad67ba0a4
|
@ -1,5 +1,5 @@
|
||||||
(ns mw-engine.core
|
(ns mw-engine.core
|
||||||
(:require mw-engine.world
|
(:require [mw-engine.world :as world]
|
||||||
mw-engine.natural-rules
|
mw-engine.natural-rules
|
||||||
mw-engine.utils))
|
mw-engine.utils))
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
these rules. As a side effect, print the world."
|
these rules. As a side effect, print the world."
|
||||||
[state]
|
[state]
|
||||||
(list
|
(list
|
||||||
(print-world (transform-world (first state) (first (rest state))))
|
(world/print-world (transform-world (first state) (first (rest state))))
|
||||||
(first (rest state))))
|
(first (rest state))))
|
||||||
|
|
||||||
(defn run-world
|
(defn run-world
|
||||||
|
|
|
@ -108,10 +108,10 @@
|
||||||
(>= n 2))
|
(>= n 2))
|
||||||
(merge cell {:wolves 2}))))
|
(merge cell {:wolves 2}))))
|
||||||
;; wolves breed.
|
;; wolves breed.
|
||||||
;; (fn [cell world]
|
(fn [cell world]
|
||||||
;; (cond
|
(cond
|
||||||
;; (>= (population cell :wolves) 2)
|
(>= (population cell :wolves) 2)
|
||||||
;; (merge cell {:wolves (int (* (:wolves cell) 2))})))
|
(merge cell {:wolves (int (* (:wolves cell) 2))})))
|
||||||
;; wolves eat deer
|
;; wolves eat deer
|
||||||
(fn [cell world]
|
(fn [cell world]
|
||||||
(merge cell {:deer (- (population cell :deer) (population cell :wolves))}))
|
(merge cell {:deer (- (population cell :deer) (population cell :wolves))}))
|
||||||
|
|
Loading…
Reference in a new issue