Enter derivation rules
A derivation rule maps single characters to output strings
The starting string is called w. You must have exactly one derivation rule for w
Samples
- Islands and lakes
- Quadratic Koch Island
- Dragon curve
- Sierpinski Gasket
- Sierpinski Gasket 2
- Sudoku
- Hexagonal Gosper Curve
- Quadratic Gosper Curve
Example
Example:
w -> FF -> F+F
On the first iteration, we look up the rule for w. The output string is F
On the second iteration, we replace every F in the input string with F+F. The output string is F+F
On the third iteration, we replace every F in the input string with F+F. The output string is F+F+F+F
And so on...
After running n iterations, the output string is used as drawing instructions. The pen starts at the origin aiming north.
Uppercase letter: draw a line one unit in the current direction+: rotateadegrees counterclockwise-: rotateadegrees clockwiseLowercase letter: move one unit in the current direction without drawing a line- Any other characters are ignored
Further reading: Chapter 1 of The Algorithmic Beauty of Plants