From 9ad67ba0a491fc4aba48e0ffea203b320831bb1f Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Wed, 2 Jul 2014 17:58:34 +0100 Subject: [PATCH] Small changes necessitated by reference from mw-ui. --- src/mw_engine/core.clj | 4 ++-- src/mw_engine/natural_rules.clj | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mw_engine/core.clj b/src/mw_engine/core.clj index bd2399c..6b6b22b 100644 --- a/src/mw_engine/core.clj +++ b/src/mw_engine/core.clj @@ -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 diff --git a/src/mw_engine/natural_rules.clj b/src/mw_engine/natural_rules.clj index 9a978b9..ddbdad1 100644 --- a/src/mw_engine/natural_rules.clj +++ b/src/mw_engine/natural_rules.clj @@ -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))}))