cl-ca: common lisp cellular automata
cl-ca is a common lisp library for implementing programs using cellular automata (e. g. Conway's game of life).
There some example programs to introduce you.
Most functions also include a docstring.
cl-ca is build around three functions which access the hash table all automata are stored in. This hash-table is located in a closure, therefore only these functions can access it.
The functions are:
set-automatonused to modify/add automata
get-automatonused to get informations about an automaton (The Hacker's note: It is just a call to
run-stepwalks over a specified part of the hash-table and calculates the new states of the automatons.
The data about the automata is stored this way in the hash-table:
(x . y) . (state function)
(the cons pair
(x . y) is the key and the list ist the value)
The function gets called each step with the list representing the automaton itself and a list of lists representing its neighbors (more on that later). It must return a list representing itself (this one then gets put in the hash-table). This allows an automaton not only change its state but also to modify its behavior.
von-neumann-neighbors implement neighborhood (See the corresponding Wikipedia articles: Moore Neighborhood and Von Neumann Neighborhood). One of these functions (or another one doing something reasonable in this context) should be passed to
run-step and is used to calculate neighborhood then.
can I ql:quickload it?
- Lukas Epple <email@example.com>
- Public Domain