Merge branch 'develop' of github.com:simon-brooke/the-great-game into develop
This commit is contained in:
commit
9490c9fd3e
12 changed files with 106622 additions and 0 deletions
24
src/cc/journeyman/the_great_game/proving/sketches.clj
Normal file
24
src/cc/journeyman/the_great_game/proving/sketches.clj
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
(ns cc.journeyman.the-great-game.proving.sketches
|
||||
"Code that's useful for exploring, but probably not part of the final
|
||||
product, and if it is, will end up somewhere else."
|
||||
(:require [wherefore-art-thou.core :refer [*genders*]]))
|
||||
|
||||
|
||||
(defn happy-cell?
|
||||
"True if all NPCs at `c` (assumed to be a MicroWorld-style cell) are of
|
||||
a happy disposition."
|
||||
[c]
|
||||
(when (:npcs c)
|
||||
(every? #(> (:disposition %) 2) (:npcs c))))
|
||||
|
||||
(defn couple-cell?
|
||||
[c]
|
||||
(let [npcs (:npcs c)]
|
||||
(when
|
||||
(every? pos?
|
||||
(map (fn [g]
|
||||
(count (filter #(and (= g (:gender %))
|
||||
(#{:ancestor :citizen} (:goal %))
|
||||
(pos? (:disposition %))) npcs)))
|
||||
(keys *genders*)))
|
||||
c)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue