From 87d7b6eca56cfac6e7d55364a817e7f777c8e3a4 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Mon, 21 May 2012 13:40:40 +0300 Subject: API change, all functions now return this, added print() --- lsys.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lsys.js b/lsys.js index b102107..ffa4479 100644 --- a/lsys.js +++ b/lsys.js @@ -9,6 +9,10 @@ function LSystem(axiom, rules) { return rules[c] || c; }); } + return this; + }; + + this.print = function() { return this.tree; }; @@ -125,7 +129,7 @@ function LSystem(axiom, rules) { this.reset = function() { this.tree = axiom; - return this.tree; + return this; }; this.debug = function() { -- cgit v1.3.1