From 18f7619fdb60e7e88daf28dcd203a6d089e54d27 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Mon, 21 May 2012 13:45:44 +0300 Subject: update homepage with API changes --- index.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 453cf97..349d2b3 100644 --- a/index.html +++ b/index.html @@ -54,8 +54,8 @@

The canonical usage would be to create the L-System itself by defining the axiom string and the production rules, running the iteration, and generating the respective cartesian coordinates.

-var lsys = new LSystem('F', { 'F': 'F-F+FF' });
-var tree = lsys.iterate(2);
+var lsys = new LSystem('F', { 'F': 'F-F+FF' }).iterate(2);
+var tree = lsys.print();
 console.log(tree);  // F-F+FF-F-F+FF+F-F+FFF-F+FF
 var coords = lsys.draw(Math.PI / 2);
 console.log(coords);  // [[[0,0,0], [0,1,0], [1,1,0], ... ]]
@@ -112,8 +112,7 @@ for (var i=0; i<coords.length; i++) { init(); draw_axes(); - var lsys = new LSystem('F', { 'F': 'F+F-F-F+F' }); - var tree = lsys.iterate(3); + var lsys = new LSystem('F', { 'F': 'F+F-F-F+F' }).iterate(3); var coords = lsys.draw(Math.PI / 2); draw_lsys(coords); animate(); -- cgit v1.3.1