Class: LSystem

LSystem(alphabet, axiom, rules)

new LSystem(alphabet, axiom, rules)

LSystem Generator
Parameters:
Name Type Description
alphabet string the characters recognized by the LSystem
axiom string The starting axiom of The LSystem generator
rules object a dictionary mapping letters to rules of LSystems
Source:

Methods

addRule(key, action)

Add an extra Rule to the LSystem
Parameters:
Name Type Description
key string the rule to add
action string the action to perform with this rule
Source:

iterate(nIters) → {string}

Iterates the LSystems
Parameters:
Name Type Description
nIters number Number of interations to compute
Source:
Returns:
The iterated resulting string.
Type
string

processString(oldStr) → {string}

Processes the Current String according to the rules in the LSystem
Parameters:
Name Type Description
oldStr string the string to be processed
Source:
Returns:
the processed string
Type
string

removeRule(key)

Removes a rule from the LSystem
Parameters:
Name Type Description
key string the rule to remove
Source: