Giter Site home page Giter Site logo

l-system's Introduction

Lindenmayer system visualizer in Clojure

The curves defined in this program are of the form

  1. initial state,
  2. replacement rule,
  3. angle (for the angle change operator - or +)
  4. 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})

Running the visualizer

It is assumed that you are using lein to build your Clojure.

  1. Download Xming X Server.
  2. To test that Xming is working, run sudo apt-get install x11-apps, export DISPLAY=:0, and finally xeyes.
  3. You'll know what xeyes is when you see it.
  4. 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.
  5. 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).

l-system's People

Contributors

joshuacheng avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.