summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <yuv.adm@gmail.com>2012-05-21 13:40:40 +0300
committerYuval Adam <yuv.adm@gmail.com>2012-05-21 13:40:40 +0300
commit87d7b6eca56cfac6e7d55364a817e7f777c8e3a4 (patch)
tree55898979c08c4d8c476b11a1106bad03862c892d
parent236d03825f0760c1b7b84baef5f9dbfcb10bd599 (diff)
API change, all functions now return this, added print()
-rw-r--r--lsys.js6
1 files changed, 5 insertions, 1 deletions
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() {