To start off with, for those of you not familiar with L-systems, here's the the Wikipedia [link]. Now that the uninformed are off informing themselves, on to business. I am trying to create a good L-system evaluator, and in the process create a turtle graphics program. (again, if unfamiliar, click [link]) I pretty much have the math down for the turtle, I just need help with the command-string reader. there's very little organization, but basically, you ask for the axiom, the rule(s), the angel( more on that later), and the iteration and it'll draw it for you. Here's the elements that it can interact with:
- F: this means 'draw forward'
- H: this is the same as F, it's only there for more variability in the rulestrings.
- C: toggles penUp on the turtle.
- G: moves with penUp. CFC or CHC would work too, but this takes up less room.
- - and +: these change the direction the turtle is facing by the angle I mentioned previously.
- [: this pushes the current state of the turtle to a LIFO stack. (LIFO means Last-In-First-Out. sorry, URL BBCode doesn't work within List BBcode.)
- ]: This pops the last element on the stack to the turtle.