L-systems: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 31: | Line 31: | ||
var t = new JSXTurtleObj(brd); | var t = new JSXTurtleObj(brd); | ||
var | var LSystem = " | ||
function expander(level) { | function expander(level) { | ||
this.source = (level>1) ? new expander(level-1) : (new function() { | this.source = (level>1) ? new expander(level-1) : (new function() { | ||
Line 90: | Line 87: | ||
return null; | return null; | ||
} | } | ||
"; | |||
function run() { | function run() { | ||
Line 98: | Line 96: | ||
t.hideTurtle(); | t.hideTurtle(); | ||
eval(code); | eval(code); | ||
eval(LSystem); | |||
var generator = new expander(level,axiom,rules); | var generator = new expander(level,axiom,rules); | ||
plotter(); | plotter(); |
Revision as of 18:32, 30 December 2008