Small changes necessitated by reference from mw-ui.

This commit is contained in:
Simon Brooke 2014-07-02 17:58:34 +01:00
parent 37fad409ba
commit 9ad67ba0a4
2 changed files with 6 additions and 6 deletions

View file

@ -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

View file

@ -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))}))