From 7d8c903ff7800d25108930c2ea4e64a62f1cd03f Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Fri, 18 May 2012 11:11:50 +0300 Subject: syntax and usage in README --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'README.md') 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 +``` -- cgit v1.3.1