summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorYuval Adam <yuv.adm@gmail.com>2012-05-18 11:11:50 +0300
committerYuval Adam <yuv.adm@gmail.com>2012-05-18 11:11:50 +0300
commit7d8c903ff7800d25108930c2ea4e64a62f1cd03f (patch)
tree7e48e52810850d5083b8b3b53a810966711e1a22 /README.md
parentc900d290a3d86a4486ac2a8790de0b89b914c47d (diff)
syntax and usage in README
Diffstat (limited to 'README.md')
-rw-r--r--README.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/README.md b/README.md
index 4c9d76f..c1d61bd 100644
--- a/README.md
+++ b/README.md
@@ -2,3 +2,22 @@ L-Systems.JS
============
A full, 3D L-Systems implementation in JavaScript
+
+Syntax
+------
+
+ - `F`: move one unit vector forward
+ - `+` / `-`: turn right / left by angle `alpha`
+ - `&` / `^`: pitch up / down by angle `alpha`
+ - `<` / `>`: roll right / left by angle `alpha`
+ - `|`: reverse vector direction
+ - `[` / `]`: push / pop current tree state
+
+Usage
+-----
+
+```js
+var lsys = new LSystem('F', { 'F' : 'F-F+FF' });
+var tree = lsys.iterate(2);
+console.log(tree) // F-F+FF-F-F+FF+F-F+FFF-F+FF
+```