summary refs log tree commit diff
path: root/lib/cell.fnl
diff options
context:
space:
mode:
authorequa <equaa@protonmail.com>2021-04-18 09:57:30 -0500
committerequa <equaa@protonmail.com>2021-04-18 09:57:30 -0500
commit0c8a8cf8d861bc4ef3162e45e8b58d2f0173d2f7 (patch)
tree5fe4e826b92173f33abf8a1f2391ccab706db230 /lib/cell.fnl
nanpa wan
commit of the last two days: working cellular automata and rendering,
prototype system, etc
Diffstat (limited to 'lib/cell.fnl')
-rw-r--r--lib/cell.fnl10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/cell.fnl b/lib/cell.fnl
new file mode 100644
index 0000000..e9af960
--- /dev/null
+++ b/lib/cell.fnl
@@ -0,0 +1,10 @@
+(local proto (require :lib.proto))
+
+{:init (proto.table-method :cell.init)
+ ;; given its 8 neighbors returns a new cell (or nil)
+ ;; TODO: other returns via either a clojure or coroutines
+ :birth (proto.meta-method :cell.birth)
+ :update (proto.meta-method :cell.update)
+ ;; returns a number from 0 to 1
+ :aliveness (proto.meta-method-opt :cell.generation #0)
+ :color (proto.meta-method-opt :cell.color #[0 0 0])}