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
|
||||
(:require mw-engine.world
|
||||
(:require [mw-engine.world :as world]
|
||||
mw-engine.natural-rules
|
||||
mw-engine.utils))
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
|||
these rules. As a side effect, print the world."
|
||||
[state]
|
||||
(list
|
||||
(print-world (transform-world (first state) (first (rest state))))
|
||||
(world/print-world (transform-world (first state) (first (rest state))))
|
||||
(first (rest state))))
|
||||
|
||||
(defn run-world
|
||||
|
|
|
@ -108,10 +108,10 @@
|
|||
(>= n 2))
|
||||
(merge cell {:wolves 2}))))
|
||||
;; wolves breed.
|
||||
;; (fn [cell world]
|
||||
;; (cond
|
||||
;; (>= (population cell :wolves) 2)
|
||||
;; (merge cell {:wolves (int (* (:wolves cell) 2))})))
|
||||
(fn [cell world]
|
||||
(cond
|
||||
(>= (population cell :wolves) 2)
|
||||
(merge cell {:wolves (int (* (:wolves cell) 2))})))
|
||||
;; wolves eat deer
|
||||
(fn [cell world]
|
||||
(merge cell {:deer (- (population cell :deer) (population cell :wolves))}))
|
||||
|
|
Loading…
Reference in a new issue