Added ruleset to model thaw after ice-age, and separated out the

herbivore/predation rules into a separate ruleset 'ecology.txt'
This commit is contained in:
Simon Brooke 2014-07-21 11:20:38 +01:00
parent cbdf01c4c2
commit ea1af2103f
7 changed files with 212 additions and 22 deletions

View file

@ -6,10 +6,22 @@ td.water {
background-color: blue;
}
td.pasture, td.grassland {
td.pasture, td.grassland, td.meadow {
background-color: lime;
}
td.crop {
background-color: yellow;
}
td.camp, td.house, td.inn, td.market {
background-color: gray;
}
td.ploughland {
background-color: brown;
}
td.heath {
background-color: chartreuse;
}
@ -29,3 +41,12 @@ td.climax {
td.fire {
background-color: orange;
}
td.error, td.plague {
background-color: red;
}
td.snow, td.ice {
background-color: white;
}

View file

@ -3033,8 +3033,7 @@ net.brehaut.ClojureTools = (function (SH) {
</td><td class="codes"></td></tr><tr><td class="docs">
</td><td class="codes"><pre class="brush: clojure">(ns mw-engine.core
(:require [mw-engine.world :as world]
mw-engine.natural-rules
mw-engine.utils))</pre></td></tr><tr><td class="docs"><p>Every rule is a function of two arguments, a cell and a world. If the rule
mw-engine.utils))</pre></td></tr><tr><td class="docs"><p>Every rule is a function of two arguments, a cell and a world. If the rule
fires, it returns a new cell, which should have the same values for :x and
:y as the old cell. Anything else can be modified.</p>

View file

@ -3053,7 +3053,7 @@ objective is to parse rules out of a block of text from a textarea</p>
function, and return the sequence of such functions.</p>
</td><td class="codes"><pre class="brush: clojure">(defn compile-string
[string]
(map #(compile-rule % true) (remove comment? (trim (split string #&quot;\n&quot;)))))</pre></td></tr><tr><td class="docs"><p>Compile each non-comment line of the file indicated by this <code>filename</code> into
(map #(compile-rule % true) (remove comment? (split string #&quot;\n&quot;))))</pre></td></tr><tr><td class="docs"><p>Compile each non-comment line of the file indicated by this <code>filename</code> into
an executable anonymous function, and return the sequence of such functions.</p>
</td><td class="codes"><pre class="brush: clojure">(defn compile-file
[filename]
@ -3404,7 +3404,7 @@ front of the sequence of tokens it returns nil.</p>
(use 'mw-engine.utils)
(let [afn (eval (parse-rule rule-text))]
(cond
(and afn return-tuple?)(list afn rule-text)
(and afn return-tuple?)(list afn (trim rule-text))
true afn))))
([rule-text]
(compile-rule rule-text false)))</pre></td></tr><tr><td class="spacer docs">&nbsp;</td><td class="codes" /></tr></table><div class="footer">Generated by <a href="https://github.com/fogus/marginalia">Marginalia</a>.&nbsp;&nbsp;Syntax highlighting provided by Alex Gorbatchev's <a href="http://alexgorbatchev.com/SyntaxHighlighter/">SyntaxHighlighter</a></div><script type="text/javascript">SyntaxHighlighter.defaults['gutter'] = false;

Binary file not shown.

After

Width:  |  Height:  |  Size: 782 B