From 0c8a8cf8d861bc4ef3162e45e8b58d2f0173d2f7 Mon Sep 17 00:00:00 2001 From: equa Date: Sun, 18 Apr 2021 09:57:30 -0500 Subject: nanpa wan commit of the last two days: working cellular automata and rendering, prototype system, etc --- lib/cell.fnl | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 lib/cell.fnl (limited to 'lib/cell.fnl') 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])} -- cgit 1.3.0-6-gf8a5