Merge branch 'develop' of github.com:simon-brooke/the-great-game into develop

This commit is contained in:
Simon Brooke 2024-04-08 22:37:36 +01:00
commit 9490c9fd3e
12 changed files with 106622 additions and 0 deletions

View 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)))