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:
parent
cbdf01c4c2
commit
ea1af2103f
7 changed files with 212 additions and 22 deletions
|
|
@ -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 #"\n")))))</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 #"\n"))))</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"> </td><td class="codes" /></tr></table><div class="footer">Generated by <a href="https://github.com/fogus/marginalia">Marginalia</a>. Syntax highlighting provided by Alex Gorbatchev's <a href="http://alexgorbatchev.com/SyntaxHighlighter/">SyntaxHighlighter</a></div><script type="text/javascript">SyntaxHighlighter.defaults['gutter'] = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue