summary refs log tree commit diff
path: root/lib/cell.fnl
diff options
context:
space:
mode:
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])}