Lindenmayer system visualizer in Clojure
The curves defined in this program are of the form
- initial state,
- replacement rule,
- angle (for the angle change operator - or +)
- initial angle
In code, the Koch curve would look like:
;Koch curve
(def koch-curve
{:init [:f :- :- :f :- :- :f]
:rules {:f [:f :+ :f :- :- :f :+ :f]}
:theta 60
:init-angle 0})
It is assumed that you are using lein to build your Clojure.
- Download Xming X Server.
- To test that Xming is working, run
sudo apt-get install x11-apps
,export DISPLAY=:0
, and finallyxeyes
. - You'll know what xeyes is when you see it.
- Note: Though you won't always need to test whether Xming is working after the first time, you must run
export DISPLAY=:0
every new command line session for running this code. - Once you confirm that Xming is working, compile the code in
lein repl
with(ns l_system_lab.core)
and(use 'l_system_lab.core :reload-all)
.